I am using the below payload. But its throwing error "transitions": "Field 'transitions' cannot be set. It is not on the appropriate screen, or unknown."
Could you please help resolve this ?
POST Method
URL : rest/api/2/issue/
Payload :
{
"fields": {
"project":
{
"key": "LRN"
},
"summary": "Sample TEst cases created using Jira API",
"description": "example of cucumber automated test - Scenario",
"issuetype": {
"name": "Test"
},
"priority" : { "name": "2-High"},
"customfield_24683": { "value": "Cucumber" },
"customfield_11040": { "value": "End to End Tests (E2E)"},
"customfield_26580" : { "value" : "ADFv2", "child" : { "value" : "API" } },
"customfield_10831" : { "value": "TestTeam"},
"transitions": [
{
"id": "11"
}
]
}
}
Having answered as below, I re-read your question and it looks as though you're trying to create an issue and transition it in one go, which I'm not sure if you can do, create it then use another API call to transition it.
You haven't specified whether it's for cloud or server, my answer assumes cloud, although it shouldn't be that much different.
When I change a ticket's status, I use
{"update":{},"transition":{"id":"141"}}
Note the update which you don't have, I think that's important
and the actual API call that I use is
/rest/api/3/issue/ABC-123/transitions?expand=transitions.fields&transitionId=141
Of course, keep your transitionId number, for me 141 is to close a ticket
Hi Warren,
Thanks for the response. I tried with Update as you suggested, now its creating the issue, but the status is not set.
{
"fields": {
"project":
{
"key": "LRN"
},
"summary": "SAmple TEst cases created using Jira API",
"description": "example of cucumber automated test - Scenario",
"issuetype": {
"name": "Test"
},
"priority" : { "name": "2-High"},
"customfield_24683": { "value": "Cucumber" },
"customfield_11040": { "value": "End to End Tests (E2E)"},
"customfield_26580" : { "value" : "ADFv2", "child" : { "value" : "API" } },
"customfield_10831" : { "value": "Leo"}
},
"update":{},
"transitions":
{
"id": "11"
}
}
Using the Get call for transitions the below are the list of transitions I got :
{
"expand": "transitions",
"transitions": [
{
"id": "11",
"name": "Start Progress",
"to": {
"self": "https://jira.com/rest/api/2/status/3",
"description": "'ASSIGNED'. This issue is being worked on by the assignee.",
"iconUrl": "https://jira.com/images/icons/statuses/inprogress.png",
"name": "In Progress",
"id": "3",
"statusCategory": {
"self": "https://jira.com/rest/api/2/statuscategory/4",
"id": 4,
"key": "indeterminate",
"colorName": "yellow",
"name": "In Progress"
}
}
},
{
"id": "71",
"name": "Automate",
"to": {
"self": "https://jira.com/rest/api/2/status/12381",
"description": "",
"iconUrl": "https://jira.com/images/icons/statuses/generic.png",
"name": "Active",
"id": "12381",
"statusCategory": {
"self": "https://jira.com/rest/api/2/statuscategory/4",
"id": 4,
"key": "indeterminate",
"colorName": "yellow",
"name": "In Progress"
}
}
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not clear whether you're doing this or not. You need to use 2 separate API calls - one to create the issue, and another to change the status.
I also notice that in your update JSON you're using transitions whereas it needs to be transition without the "s" at the end.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Warren,
I tried both transition and transitions, for both it didnt work. I was trying to use create API to create and update in the same payload. Is it not possible to use same payload for create and update?
should it be separate API call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I don't believe that it can be done in 1 step, you will need to run 2 separate API calls
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Warren, Thanks a lot. Its working with multiple API calls. Is there a way to do it in bulk ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You haven't said how you're running these API calls - via code or Postman or something else.
The easiest way to perform this procedure in bulk is via code. You have a loop for the number of issues that you want to create and run the 2 calls for each issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.