Forums

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

Unable to update issue status using JIRA API..

Deleted user November 15, 2019

Hi All,

I am trying to update the status of the issue with the below REST URL,

JIRA Server URL/rest/api/3/issue/{IssueKey}/transitions?expand=transitions.fields

Using the below Json Format.

{
"update": {
     "comment": [
               {
                   "add": {
                  "body": {
                 "content": [
             {
                "type": "paragraph",
                "content": [
              {
                   "text": "Transition Update from JIRA API..",
                   "type": "text"
             }
        ]
         }
      ]
    }
     }
  }
 ]
},
"fields": {
"assignee": {
"name": "abc"
},
"resolution": {
"name": "Postponed"
}
},
"transition": {
"id": "10201"
}
}

But unable to update the Issue status and comments. Giving the below error..

"The remote server returned an error: (400) Bad Request." 

Can anyone pls suggest on the same?

Thanks

Vishnu

 

4 answers

0 votes
Edgars Everts January 29, 2021

Hi,

I tried to update Status with Integration User by sending Transitions ID, which is valid by Workflow.

POST /rest/api/2/issue/{issueIdOrKey}/transitions

{
"transition": {"id": "17"}
}

It fails with message:
It seems that you have tried to perform a workflow operation (<Action Name>) that is not valid for the current state of this issue (ISSUEKEY-17). The likely cause is that somebody has changed the issue recently, please look at the issue history for details.
But ISSUEKEY-17 has no history details.

But GET /rest/api/2/issue/{issueIdOrKey}/transitions for Integration user

returns no TransitionID.

Just wonder is it Integration User project role & permission issue?
Any ideas what to check?

Looking forward your respones.
Thank you in advance.

Kind regards

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
November 18, 2019

Hello @Warren ,  @[deleted] 

 transitionId was used in json payload.

"transition": {
"id": "10201"
}

So, it would be redundant to use it in Url querystring.

Would it be because of rest api version? Could you also try using 2 instead of 3 as below?

 /rest/api/2/issue/{issueIdOrKey}/transitions?expand=transitions.fields

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2019

Hi @[deleted] 

When I transition items via the API, I also have &transitionId=XXX added to the call, so please try

/rest/api/3/issue/{IssueKey}/transitions?expand=transitions.fields&transitionId=10201
0 votes
Tuncay Senturk _Snapbytes_
Community Champion
November 15, 2019

Hello @[deleted] 

The URL and json payload seems fine. However, are you sure Jira server URL/context is right or are you using Http POST method?

Because 400 error codes are related to the missing URLs/resources.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events