Unable to update the comment and transition id in a single rest api call.

Deeksha Rastogi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2019

I am using JIRA Software 30 days trail cloud license.

There i am trying to update the comment as well as transition id of issue in a single api call for scrum project issue but unable to do so.

Api consuming :: POST /rest/api/2/issue/{issueIdOrKey}/transitions

Method: Post

payload: 

{
"update": {
"comment": [
{
"add": {
"body": "To Do"
}
}
]
},
"transition": {
"id": "11"
}
}

Using above call issue transition changed but comment not updated in the issue.

Thanks,

Deeksha

1 answer

0 votes
Andrew
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.
July 16, 2019

Hi @Deeksha Rastogi 

Issue have a lots comment, I suppose API cannot identify which one You mean.

Look here https://docs.atlassian.com/software/jira/docs/api/REST/8.1.2/#api/2/issue-updateComment

B.R.

Deeksha Rastogi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 16, 2019

Hi @Andrew ,

api :: https://docs.atlassian.com/software/jira/docs/api/REST/8.1.2/#api/2/issue-doTransition

This specifies in payload that we can send the transition id as well as comment using the same api call. But i am unable to do that. Please help.

Andrew
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.
July 17, 2019

Hi @Deeksha Rastogi ,

I have checked with REST client. 

I can change transition with /rest/api/2/issue/DEMO-2/transitions but cannot add comment.

body:

{
"update": {
"comment": [
{
"add": {
"body": "Bug has been fixed."
}
}
]
},
"transition": {
"id": "41"
}
}

I can add comment use /rest/api/2/issue/DEMO-2/comment

I suppose docs has mistake. Looks like we cannot change transition and comment in one REST. 

https://community.atlassian.com/t5/Jira-questions/How-to-change-the-issue-status-by-REST-API-in-JIRA/qaq-p/850658

B.R.

Suggest an answer

Log in or Sign up to answer