We have noticed that when trying to add a comment and transition the issue at the same time that the comment does not get added to the issue but the issue is transitioned to the proper state. The status code that is returned is HttpStatusCode.NoContent. We have verified that the json is valid and i have included it for your reference as well. The other part that is strange about this issue is that it only occurs when transitioning from the first step in a workflow. If we use the exact same json string with a different transition id on a later step in the workflow the comment is indeed added as expected. What is the reason this is happening and how can we resolve this?
{
update: {
comment:
{
add: {
body: Approved By: bacoach On : 1/3/2013
9:55:19 AM n nWant to approve this,
visibility: {
type: role,
value: sponsor
}
}
}
},
transition: {
id: 711
}
}
Hi Ryan,
Looking at your question here, I understand that you wanted to transition an issue with adding a comment using REST API. If this is true, I just did a quick test on my end, and I am able to transition an issue using the following cURL command:
curl -D- -u admin:admin -X POST --data @/Users/BaBs/Desktop/test.json -H "Content-Type: application/json"http://localhost:8080/jira/rest/api/2/issue/JC-11/transitions?expand=transitions.fields
Basically, you could try to run the same command by switching the user credentials, the location of the JSON data and also the hostname and I hope that it will help. For your reference, the content of the JSON file is pasted below:
{ "update": { "comment": [ { "add": { "body": "Comment added when resolving issue" } } ] }, "transition": { "id": "5" } }
In my local instance, the transition with the ID 5 will resolve an issue.
You may kindly refer to the following documentation for more info on transitioning issue via REST:
http://docs.atlassian.com/jira/REST/latest/#id342828
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.