-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Space - Configure Space - Custom Template
-
None
-
1
-
1
Issue Summary
Creating projects based on a custom template using the Create Custom Project API fails with below error:
{
"errorMessages": [
"Invalid request payload. Refer to the REST API documentation and try again."
]
}
Steps to Reproduce
- Invoke the API using payload like below (following the documentation mentioned - Create Custom Project )
{
"details": {
"key": "CUSTTEMP1",
"name": "Custom Template Project 1",
"assigneeType": "PROJECT_LEAD",
"leadAccountId": "712020:c01aac04-431e-4f37-b100-ce5ffea1d6ae",
},
"template": {
"scope": {
"type": "GLOBAL"
},
"role": {
"roles": [
{
"name": "Administrators",
"description": "Project administrators",
"defaultActors": null,
"pcri": "pcri:role:ref:admin-role"
},
{
"name": "Developers",
"description": "Project developers",
"defaultActors": null,
"pcri": "pcri:role:ref:dev-role"
}
],
"roleToProjectActors": {
"pcri:role:ref:admin-role": [
"pcri:user:id:712020:c01aac04-431e-4f37-b100-ce5ffea1d6ae"
],
"pcri:role:ref:dev-role": [
"pcri:group:name:jira-software-users-ces-support-emea"
]
}
}
}
}
Expected Results
Successful 200 response
Actual Results
400 Bad request
{
"errorMessages": [
"Invalid request payload. Refer to the REST API documentation and try again."
]
}
Workaround
At this time, the recommended way to create projects from custom templates is via the Jira UI.
If using the UI is not feasible and you must rely solely on the REST API, a possible workaround is to first use an existing project as the source. Specifically, if you already have a project whose configuration you want to reuse, you can leverage the Extract API to capture that project’s template and then use it as the basis for creating new projects via the Create Custom Project API.
This is an Internal API and it is not subject to standard public API guidelines and is subject to change anytime. Please use with caution.
Execute JS code in browser console
- Open customer site, open developer console

- Modify script below
-
- replace host name https://lettuce.jira-dev.com to actual site
-
- replace projectId: 10028 to actual project id
-
- update body to desired mode according to supported usage
fetch('https://lettuce.jira-dev.com/rest/api/3/project-template/extract', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, // Body exactly as specified body: JSON.stringify({ projectId: 10001, templateQueryParameters: { defaultDepth: 'DEEP', depthOverrides: {} } }), // Include credentials so your logged-in session is used credentials: 'include', // Optional: avoid cached responses cache: 'no-store' }) .then(async (res) => { const text = await res.text(); try { const json = JSON.parse(text); console.log('Status:', res.status); console.log('Response JSON:', json); return json; } catch { console.log('Status:', res.status); console.log('Raw response:', text); return text; } }) .catch((err) => { console.error('Request failed:', err); });
- update body to desired mode according to supported usage
API supported usage guide
For body section:
body: JSON.stringify({
projectId: 10001,
templateQueryParameters: {
defaultDepth: 'DEEP',
depthOverrides: {}
}
}),
Supported templateQueryParameters usage as below:
TMP project
Only supported mode.
templateQueryParameters: {
defaultDepth: 'DEEP',
depthOverrides: {}
}
CMP project
CMP project supports 4 extraction
Mode 1 - Shallow : This is equivalent to not ticking any checkboxes from the UI
templateQueryParameters: {
defaultDepth: 'SHALLOW',
depthOverrides: {}
}
Mode 2 - Workflow deep : This is equivalent to check the below option only in the UI

templateQueryParameters: {
defaultDepth: 'SHALLOW',
depthOverrides: {
workflow: 'DEEP'
}
}
Mode 3 - Screens deep : This is equivalent to check the below option only in the UI

templateQueryParameters: {
defaultDepth: 'SHALLOW',
depthOverrides: {
field: {
screen: 'DEEP',
screenScheme: 'DEEP',
issueTypeScreenScheme: 'DEEP'
}
}
}
Mode 4 - Both screens and workflow deep : This is equivalent to check both options in the UI.

templateQueryParameters: {
defaultDepth: 'SHALLOW',
depthOverrides: {
workflow: 'DEEP',
field: {
screen: 'DEEP',
screenScheme: 'DEEP',
issueTypeScreenScheme: 'DEEP'
}
}
}