When adding a comment and transitioning to next step in a workflow. The comments are not added to the issue.

Ryan Hamooud January 2, 2013

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

}

}

2 answers

0 votes
Renjith Pillai
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.
January 6, 2013
Is this transition having a screen associated?
0 votes
Faisal
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.
January 6, 2013

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!

Suggest an answer

Log in or Sign up to answer