Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Updating transitions using PUT method of the issue

Rajesh Kumar Ganjikunta January 2, 2022

Hi all,

I am working on doing an integration with Jira using the V2 and V3 API's, one of the problems I am facing is that I can not update the current status using the PUT API even though it is documented.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put

Sample Payload
https://cloudenrich.atlassian.net/rest/api/2/issue/{IssueKey}/

{
 "update": {
 "comment": [
 {
 "add": {
 "body""Bug has been fixed."
 }
 }
 ]
 },
 "transition": {
 "id""5"
 }
}

 
I can see the comment gets added but the transition doesn't change.
If I use the following API it works for transition only

https://cloudenrich.atlassian.net/rest/api/2/issue/{IssueKey}/transitions/

"transition": {
 "id""5"
 }

Can someone please help to identify if it is a bug or known behavior?
If it is a bug, please let me know how to file the same?

Regards
Rajesh.

1 answer

1 vote
Pramodh M
Community Champion
January 3, 2022

Hi @Rajesh Kumar Ganjikunta 

Use the below API and let me know if it works

curl --request POST \
--url "https://your-site.atlassian.net/rest/api/3/issue/GAP-3/transitions" \
--user 'email:token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "transition": { "id": "tranistion-id" },
"update": { "comment": [ { "add": { "body": { "type": "doc", "version": 1, "content": [
{ "type": "paragraph", "content": [ { "text": "Bug has been fixed", "type": "text" }]}]}}}]}}'

Thanks,
Pramodh

Rajesh Kumar Ganjikunta January 3, 2022

Hi @Pramodh M 

Thank you very much for your quick answer

I am able to use the api provided. My goal is to make multiple updates to the jira fields in a Single API call and hence was using the PUT API of the issues instead of transitions API.

Can we say this a bug in JIRA API as the documentation states that the transitions can be handled using the PUT API also


Regards,
Rajesh

Pramodh M
Community Champion
January 3, 2022

I understand, @Rajesh Kumar Ganjikunta 

When you make this call, there is no transition parameter to edit an issue

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-editmeta-get

If you need to make a transition and edit the field use it as well, adding to this have the fields that you need to edit in the screen.

Or make two separate calls one with transition and another with the edit.

Thanks,
Pramodh

Rajesh Kumar Ganjikunta January 3, 2022

Hi @Pramodh M 

Thank you for your quick help.
I will use the updated API's.


Regards,
Rajesh.

Swastik Mishra
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 21, 2023

@Rajesh Kumar Ganjikunta Did you find a workaround?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events