Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to update issue status using JIRA API..

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

Hello @vkalakuntla 

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.

0 votes
Warren Community Leader Nov 18, 2019

Hi @vkalakuntla 

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

Hello @Warren ,  @vkalakuntla 

 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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

688 views 2 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you