I am trying to write a method that will allow users to close a JIRA issue using json. Here is the url I am using:
../jira/rest/api/latest/issue/MyProj-524/transitions
Here is my json string:
{ "update" : {"comment": [{"add": {"body":"Fixed"}}]}, "fields" : { "resolution" : {"id":"10000","name":"Done" }}, transition": {"id": "6"}}
I get a 400 exception (Bad Request) and status of ProtocolError. According to the documentation 400 will be returned if there is no transition specified.
Also when I query the JIRA server from my browser with..:8090/jira/rest/api/latest/issue/MyProj-524/transitions
I get the following:
{"expand":"transitions","transitions":[{"id":"5","name":"Resolve Issue","to":{"self":"/jira/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":"..8090/jira/images/icons/statuses/resolved.png","name":"Resolved","id":"5","statusCategory":{"self":"...8090/jira/rest/api/2/statuscategory/3","id":3,"key":"done","colorName":"green","name":"Done"}}},{"id":"2","name":"Close Issue","to":{"self":".:8090/jira/rest/api/2/status/6","description":"The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.","iconUrl":"..8090/jira/images/icons/statuses/closed.png","name":"Closed","id":"6","statusCategory":{"self":"8090/jira/rest/api/2/statuscategory/3","id":3,"key":"done","colorName":"green","name":"Done"}}}]}
So it appears there are available transitions. We are using the "Classic Default Workflow" that contains: Open, Resolved, Closed, Reopened, and In Progress. The current status of the ticket is: Open.