Update jira request status with comments using rest api.

Hi, I'm trying to update the request status with rest api.

ACording to https://docs.atlassian.com/jira/REST/latest/#d2e3569, I could use something like "{"update":{"comment":{"add":{"body":"some comment"}}},"transition":{"id":"71"}}" to update the request status and comment. But I always get error message:

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: org.apache.catalina.connector.CoyoteInputStream@418f2690; line: 1, column: 12] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean["update"])

If I don't add "update" component in the updating data, i.e, only {"transition":{"id":"71"}}, then the status transition works fine. Now I need to update status and comment in two curl requests.

Maybe I need to configure 'comments' to configured to appear on the transition screen? But it seems every time I update status from Jira interface, there's always a comment field for me to input something.

Anyone could see why? Thanks!

1 answer

1 accepted

Hi Rulin,

I think the problem with your request is that you are missing a crucial part of the json: The comment is always an array, so you will have to place it in [ ].

"{"update":{"comment":[{"add":{"body":"some comment"}}]},"transition":{"id":"71"}}"

Thanks Marten. Indeed, I need to use double array in php to represent '['.

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
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

70 views 2 3
Join discussion

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