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

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

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!

Is this transition having a screen associated?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

309 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you