Is it possible to set an assignee and apply a transition (change status) in a single call to the Jira Cloud REST API? The example from the documentation here seems to imply that you can, but it does not work when I tested it.
Here's some examples (with curl
): Site
curl --request PUT \
--url "https://mysite.atlassian.net/rest/api/2/issue/project-123" \
--user "johnsmith@example.com:abcdef1234567890abcdef00" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"fields": {
"assignee": { "accountId": "987654321fedcba987654321" }
}
}'
curl --request POST \
--url "https://mysite.atlassian.net/rest/api/2/issue/project-123/transitions" \
--user "johnsmith@example.com:abcdef1234567890abcdef00" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"transition": { "id": 1 }
}'
curl --request POST \
--url "https://mysite.atlassian.net/rest/api/2/issue/project-123/transitions" \
--user "johnsmith@example.com:abcdef1234567890abcdef00" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"fields": {
"assignee": {
"accountId": "987654321fedcba987654321"
}
},
"transition": {
"id": 1
}
}'
curl --request PUT \
--url "https://mysite.atlassian.net/rest/api/2/issue/project-123" \
--user "johnsmith@example.com:abcdef1234567890abcdef00" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"fields": {
"assignee": {
"accountId": "987654321fedcba987654321"
}
},
"transition": {
"id": 1
}
}'
Hi @Sidharth David welcome on the community.
I just tested your case and I found the cause of your problem.
You need to create Transition screen and assign it to the transition. This screen must at least has Assignee field confiured.
It should work...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.