I would like to be able to close a Jira Issue via rest api call. Has anyone had any experience doing this? Any help would be greatly appreciated.
thanks,
Colin
It turns out I was missing the word " transitions" from the url: rest/api/2/issue/IT-44/transitions. I spent most of the time trying to figure out what was wrong with the body of the request. The documentation for the body is incorrect so always use what you get back from the transitions method call as your documentation: /rest/api/2/issue/{issueIdOrKey}/transitions?expand=transitions.fields
Use transitions. http://docs.atlassian.com/jira/REST/latest/#id129045
Jobin, I can't seem to get this to work. This json updates the summary but does nothing for the status.
{
"fields":
"summary": "Updated summary"
},
"transition":
"status": "Closed"
}
Any thoughts?
Your transition section looks wrong to me. It should look more like
"transitions": { "id": "2" }<br><br>The number needs to correspond to your closed transition. <br><br>http://docs.atlassian.com/jira/REST/latest/#id128971<br>
Thanks for the input Jobin and Norman. I've tried both of your examples and it is not working. It could be a bug.
Has anyone had any success closing issue from the rest api?
I'm afraid there's still an ongoing issue with REST and resolving issues (so that would make this a metaissue )
- We need a transition identifier in order to perform a transition, not just its textual representation.
- The only way I'm aware of right now to get that transition ID is via the following REST GET call: api/2/issue/<issue_key>/transitions?expand=transitions.fields
- This is NOT working for issues with workflows having global/common transition defined. (I'm getting the same NPE as the one described in https://jira.atlassian.com/browse/JRA-32132)
- There is a suggested fix dated 26/Jul/2013 which other users suggest its working for them
This is crucial in that it prevents our transition from using SOAP (which AFAIK is scheduled to be removed in Jira 7) to REST.
Warm regards,
Elias
You have to add another workflow from "Any status" to "Closed",
then find out its id by using this api with GET :
/rest/api/2/issue/{issueIdOrKey}/transitionsFinally, call the same api with POST to forcefully close your case from any status.
Post body should look like: {"transition": {"id": "your closed status id"}}
It looks like you're new here. Sign in or register to get started.