Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add comments on issue transition, using REST

Valerie AQUILA August 25, 2013

Hello All,

I'm with Jira 5.2.

I use

<h6>/rest/api/2/issue/{issueIdOrKey}/transitions</h6>

to POST transitions, with optional "fields" and "update"

- transition alone works fine

- transition with "fields" works fine also, the fields are correctly changed when the transition is done

- transition with "update" does not work as expected : the transition is done, but the comments are not created, and no error is sent back.

My posted json is :

{"update":{"comment":[{"add":{"body":"info ici"}}]},"transition":{"id":"51"}}

The "Add Comment" permission is open for all jira-users.

What am I doing wrong ???

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Valerie AQUILA August 26, 2013

Yes, the Add Comments permission on the permission scheme for the project is open for all jira-users.

And when I send a comment REST POST just after the transition REST POST, it works !

So I can envisage this as a workarround, but would like to understand why I can't create comment during the transition

Valerie AQUILA September 22, 2013

@rambanam : thanks for your time speding on my question, but I haven't been able to add a comment with the same transition REST POST.

So I run 2 separate POST, and it works. This is the only workarround I have found.

1 vote
Deleted user April 29, 2016

same issue on JIRA v7.1.2. The transition succeeded without the comment and no error occurred making the call. No permissions issues. I had to create a new Screen allowing comments for the Transition during the Workflow. This—https://confluence.atlassian.com/jirakb/how-to-add-a-comment-during-a-transition-779160682.html

Before: performing the same Transition in the UI did not ask for a comment.

After: now the Transition in the UI throws up a dialog asking for a comment and it works via API.

Ed Jackson October 26, 2016

I'm glad you figured this out! It saved me a lot of grief this morning.

0 votes
RambanamP
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.
August 25, 2013

the following string worked for me

{ "update": {"comment": [ { "add": {"body": "Testing."} }]},"fields": {}, "transition": { "id": "21" }}

Valerie AQUILA August 26, 2013

Rambanam,

Thanks for your time on my question.

If I try with your string (with "fields" : {}), it does not work either for me.

It seems the issue does not come from my REST call, that sends me no error.

I may have something else wrong in my config, but can't find what ??

Note, that if I POST the comment separately, it works !!??!!

RambanamP
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.
August 26, 2013

can you check Add Comments permission is there on that project permission scheme

or transition issue in UI and check are able to comment on that issue

RambanamP
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.
August 26, 2013

it is weird!! i can able to to transition issue with comment!!

paul grant March 7, 2014

Add comments screen to the transition in your workflow.

0 votes
Chaithra N
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.
August 25, 2013

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events