Hello!
I am trying to create a project over a REST call (POST) via Postman, but I am only gettig Error 400 back.
I got the code from the Atlassian Support, just changed some values for my reasons.
Error I am getting back in Postman is:
"Invalid request payload. Refer to the REST API documentation and try again."
I allready did the stringify workaround, but I am sending the call as JSON via Postman.
AND I am using this code in an Automation to create a project from a web request.
The Postman code might be wrong, but the web request should work.
Here is my code - values are cleared for Data privacy reasons, but in my code they are filled correctly.
{
"details": {
"key": "TSTPFV",
"name": "Testproject in Postman for validation",
"description": "",
"accessLevel": "OPEN",
"leadAccountId": "--",
"projectTypeKey": "software",
"enableComponents": true
},
"template": {
"scope": {
"type": "GLOBAL"
}
"project": {
"pcri": "pcri:project:id:--",
"fieldLayoutSchemeId": "pcri:fieldLayoutSchemeId:id:--",
"issueTypeSchemeId": "pcri:issueTypeScheme:id:--",
"notificationSchemeId": "pcri:notificationScheme:id:--",
"permissionSchemeId": "pcri:permissionScheme:id:--",
"workflowSchemeId": "pcri:workflowScheme:id:--"
}
"board": {
"pcri": "pcri:board:id:--",
"name": "TSTPFV board",
"enableSprint": false,
"columns": [
{
"name": "Backlog",
"statusIds": [
"pcri:status:id:--"
]
},
{
"name": "Selected for Development",
"statusIds": [
"pcri:status:id:--"
]
},
{
"name": "In Progress",
"statusIds": [
"pcri:status:id:3"
]
},
{
"name": "Done",
"statusIds": [
"pcri:status:id:--"
]
}
]
}
}
}
Which API endpoint are you using to create a project?
I just did this on my free tier and it worked, the payload in Postman I used as example
Maybe the title of the post was a little bit confusing:
I want to create a project by sending a web request triggered by an automation in Jira (JSM).
The code I posted is the code I got from an Atlassian developer.
As he says, the code should create a project, using my custom template - not one jira is providing.
So I am looking for a code to create a new project using a custom template triggered by an automation inside jira.
BR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That code seems like in an app or on server/DC, not cloud.
As creating a board on a project is a different API endpoint and can't be used in the project endpoint, as can be viewed in the api documentation.
Just as permission and workflow schemes are different endpoints to call to set these on a project.
For a board the Jira Cloud Software api needs to be used. (https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-group-board )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc - Devoteam
Ahh ok - that would explain a lot.
So if I want to create a project out of a custom template using API on cloud, I would need the code you provided?
Or could I also use this code:
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also - what value does "projectTemplateKey" need, if I want to use my custom template from my cloud.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc - Devoteam
One question:
When defining the field sector, I got the values for all of them, but
Where can I find the correct values that need to be given here?
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think this can't be don yet, as the link references a non existing page.
And I found this feature request https://jira.atlassian.com/browse/JRACLOUD-74697
You might want to check this for clarity with Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I solved my biggest mistake.
I thought, that it would be possible to use one of my custom created templates, that are used in MY cloud as a template in the API call. But this does not work.
The "Create project" POST is a basic project, that would not look different if I clicked on "create project" in Jira.
The new "Create custom project" POST from API v3 needs me to set the values I would like to use - so I need to find out, what templates I am using and set the IDs of all the schemes.
The only thing I need to know now is:
Will the code work as a web request triggered by an automation if it looks like this:
"details": {
"accessLevel": "OPEN",
"additionalProperties": {},
"assigneeType": "UNASSIGNED",
"avatarId": 11000,
"categoryId": 11000,
"description": "{{issue.description}}",
"enableComponents": true,
"key": "{{issue.customfield_11201}}",
"language": "en",
"leadAccountId": "{{creator.accountId}}",
"name": "{{issue.summary}}",
},
"template": {
"boards": {
"boards": [
{}
]
},
"field": {
"customFieldDefinitions": [
{}
],
"fieldLayoutScheme": {},
"fieldLayouts": [
{}
],
"issueLayouts": [
{}
],
"issueTypeScreenScheme": {},
"screenScheme": [
{}
],
"screens": [
{}
]
},
"issueType": {
"issueTypeHierarchy": [
{}
],
"issueTypeScheme": {},
"issueTypes": [
{}
]
},
"notification": {
"description": "<string>",
"name": "<string>",
"notificationSchemeEvents": [
{}
],
"onConflict": "FAIL",
"pcri": {}
},
"permissionScheme": {
"addAddonRole": true,
"description": "<string>",
"grants": [
{}
],
"name": "<string>",
"onConflict": "FAIL",
"pcri": {}
},
"project": {
"fieldLayoutSchemeId": {},
"issueSecuritySchemeId": {},
"issueTypeSchemeId": {},
"issueTypeScreenSchemeId": {},
"notificationSchemeId": {},
"pcri": {},
"permissionSchemeId": {},
"projectTypeKey": "software",
"workflowSchemeId": {}
},
"role": {
"roleToProjectActors": {},
"roles": [
{}
]
},
"scope": {
"type": "GLOBAL"
},
"security": {
"description": "Newly created issue security scheme",
"name": "New Security Scheme",
"pcri": {},
"securityLevels": [
{}
]
},
"workflow": {
"statuses": [
{}
],
"workflowScheme": {},
"workflows": [
{}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
According to Postman, this is the body you need:
https://www.postman.com/api-evangelist/atlassian-jira/request/l0flj0q/create-project
The JIRA API
The body:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aaron Pavez _ServiceRocket_
So I downloaded the Postman Collection of REST API v3 from the Atlassian Developer site (The Jira Cloud platform REST API)
There I started the "Create custom project" POST call.
with the code I did post here.
The code I got from an Atlassian Developer.
So here is the thing:
I want to create a project using a custom template. The project should be created by an automation via web request.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.