The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to update issue status edit api?

sbmaggarwal
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!
May 26, 2016

I am using 'https://domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}' to edit an issue. I want to use the same API to change the status as well. While following works in edit with PUT method,

{
    "fields":
    {
        "assignee":{"name":"assigneeKey"},
        "priority":{"name":"Highest"},
        "issuetype" : {"name" : "Bug"},
		"summary": "Summary"
    },
    "update": {
			"description": [{
				"set": "Hello description"
			}]
    }
}

'transition' key doesn't work for me. I used it like this 

"transition": {
            "id": "1"}

directly inside the root JSONObject. Server returned with 204 status code but no change was done in Issue.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Nic Brough -Adaptavist-
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 Champions.
May 26, 2016

Is transition 1 representing a transition that exists in the workflow?  Is the issue in the right status?  (i.e. the transition is the one that takes it out of that status/step to the desired one?).  Does the workflow have any validators or conditions on it that might be blocking the transtion? (Although I'd expect an error there, rather than a simple 204)

Edit: sorry, that was far too short!  I've tried to improve it.

sbmaggarwal
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!
May 26, 2016

I tried values from 1 to 20 randomly.. None works. I mean I get a 204 No Content response but status doesn't change. To answer your question, 1 is valid.

Nic Brough -Adaptavist-
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 Champions.
May 26, 2016

Random numbers really aren't going to do anything!  Could you look at the text view of the workflow?  Especially for the step the issue is currently in?

Steven F Behnke
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 Champions.
May 26, 2016

Just a tidbit to add to Nic's great answer, you can use the API to get all transitions and ID's valid for your current state for a specific issue – http://jira.example.com/rest/api/2/issue/TST-123/transitions

The documentation for this REST endpoint is avaliable here – https://docs.atlassian.com/jira/REST/latest/#api/2/issue-getTransitions

 

Otherwise Nic is right, the correct id value is in the Workflow Editor.

TAGS
AUG Leaders

Atlassian Community Events