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

JIRA REST API For Transitions not working

Bhumika Dhotre May 20, 2013

We are trying to use Jira REST API for integration with our application. We could successfully use the API for creating Issues.However when we try to update the issue status , it doesn't work.

Following is the request format:

"{ "update ":{ "comment ": [{ "add ": { "body ": " Fixed"}}]}, "transition ": { "id ": "5"}}, "fields ":{ "resolution ":{ "name ": "Duplicate "}}"

The comment is updated and we get a response code as 204

But the status in Jira is not updated and shows as 'Unresolved'.

Are we missing something in the request format?? please suggest.

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Bhumika Dhotre May 27, 2013

I was using PUT method instead of POST. This works on the use of POST

1 vote
Jobin Kuruvilla [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 Leaders.
May 20, 2013

Transition is a separate method. Not the same as update.

See https://docs.atlassian.com/jira/REST/latest/#id164500

0 votes
biplab July 10, 2014

Hey, I am facing the issue as i am getting the 204 code but in fact the transition is not successful .what i understood it is due to the some fields that are having some validations as required field ect but the rest api is not validation the validation while doing a transaction so I am also stuck on the same . Pleased inform if u got any solution for it

Mario March 2, 2018

Try to do the same operation in Jira app.

In my case, the issue was that a new required field must be selected to enable the transition.

I selected a value for this field through the Jira app, then I tried again consuming the Rest Api and it has worked!

0 votes
Bhumika Dhotre May 22, 2013

still not updating

0 votes
Zul NS _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2013

You have an extra "}" after specifying the transition ID, which gives the possibility why it doesn't update the resolution. Try this:

{
    "update": {
        "comment": [
            {
                "add": {
                    "body": "Fixed."
                }
            }
        ]
    },
    "fields": {
        "resolution": {
            "name": "Duplicate"
        }
    },
    "transition": {
        "id": "5"
    }
}

0 votes
Bhumika Dhotre May 21, 2013

even this doesn't work .

"{"transition ": { "id ": "5"}}, "fields ":{ "resolution ":{ "name ": "Duplicate "}}"

I am not sure if I am missing something or if I need to change some settings in jira

I get this

{"expand":"transitions","transitions":[{"id":"4","name":"Start Progress","to":{"self":"http://localhost:8080/rest/api/2/status/3","description":"This issue is being actively worked on at the moment by the assignee.","iconUrl":"http://localhost:8080/images/icons/status_inprogress.gif","name":"In Progress","id":"3"},"fields":{}},{"id":"5","name":"Resolve Issue","to":{"self":"http://localhost:8080/rest/api/2/status/5","description":"A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.","iconUrl":"http://localhost:8080/images/icons/status_resolved.gif","name":"Resolved","id":"5"},"fields":{"assignee":{"required":false,"schema":{"type":"user","system":"assignee"},"name":"Assignee","autoCompleteUrl":"http://localhost:8080/rest/api/latest/user/assignable/search?issueKey=DEMO-26&username=","operations":["set"]},"fixVersions":{"required":false,"schema":{"type":"array","items":"version","system":"fixVersions"},"name":"Fix Version/s","operations":["set","add","remove"],"allowedValues":[]},"resolution":{"required":true,"schema":{"type":"resolution","system":"resolution"},"name":"Resolution","operations":["set"],"allowedValues":[{"self":"http://localhost:8080/rest/api/2/resolution/1","name":"Fixed","id":"1"},{"self":"http://localhost:8080/rest/api/2/resolution/2","name":"Won't Fix","id":"2"},{"self":"http://localhost:8080/rest/api/2/resolution/3","name":"Duplicate","id":"3"},{"self":"http://localhost:8080/rest/api/2/resolution/4","name":"Incomplete","id":"4"},{"self":"http://localhost:8080/rest/api/2/resolution/5","name":"Cannot Reproduce","id":"5"}]},"worklog":{"required":false,"schema":{"type":"array","items":"worklog","system":"worklog"},"name":"Log Work","operations":["add"]}}},{"id":"2","name":"Close Issue","to":{"self":"http://localhost:8080/rest/api/2/status/6","description":"The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.","iconUrl":"http://localhost:8080/images/icons/status_closed.gif","name":"Closed","id":"6"},"fields":{"assignee":{"required":false,"schema":{"type":"user","system":"assignee"},"name":"Assignee","autoCompleteUrl":"http://localhost:8080/rest/api/latest/user/assignable/search?issueKey=DEMO-26&username=","operations":["set"]},"fixVersions":{"required":false,"schema":{"type":"array","items":"version","system":"fixVersions"},"name":"Fix Version/s","operations":["set","add","remove"],"allowedValues":[]},"resolution":{"required":true,"schema":{"type":"resolution","system":"resolution"},"name":"Resolution","operations":["set"],"allowedValues":[{"self":"http://localhost:8080/rest/api/2/resolution/1","name":"Fixed","id":"1"},{"self":"http://localhost:8080/rest/api/2/resolution/2","name":"Won't Fix","id":"2"},{"self":"http://localhost:8080/rest/api/2/resolution/3","name":"Duplicate","id":"3"},{"self":"http://localhost:8080/rest/api/2/resolution/4","name":"Incomplete","id":"4"},{"self":"http://localhost:8080/rest/api/2/resolution/5","name":"Cannot Reproduce","id":"5"}]},"worklog":{"required":false,"schema":{"type":"array","items":"worklog","system":"worklog"},"name":"Log Work","operations":["add"]}}}]}.
 
when I query
http://localhost:8080/rest/api/2/issue/DEMO-26/transitions?expand=transitions.fields
 
 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events