Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding resolved comment when closing via API

Ben Hart
Contributor
May 31, 2024

So I can successfully transition an issue in the service desk, to resolved via the API.  I cannot however add a closing comment.

Going by the example here: api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post 

They show this:

"comment": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Issue resolved and closed by AAP"
}
]
}
]
}

However nothing is added to the now Closed issue as any sort of comment. I wanted to ask if anyone had a working example of how to add a resolution/closing comment in teh same call as the transition, or should they be separate calls?

1 answer

0 votes
Trudy P Claspill
Community Champion
May 31, 2024

Hello @Ben Hart 

Is that the full payload you are providing with the API call? If not, can you show us the full payload?

Also, that doesn't match what I see as examples in the referenced documentation.

Screenshot 2024-05-31 at 11.15.02 AM.png

Ben Hart
Contributor
May 31, 2024

Well the full payload is:

 

{
"transition": {
"id": "111"
},
"comment": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Issue resolved and closed by AAP"
}
[
}
]
}
}

 

However I did initially try and mimic exact what you listed there. (I feel like i should clarify here.. I literally copied exactly the same format as in the example)  That generates:

"Operation value must be an Atlassian Document (see the Atlassian Document Format)"

And trying to find help for that is an exercise in futility.

Trudy P Claspill
Community Champion
May 31, 2024

I have not tried to use the v3 API for this specifically. v3 is still tagged as being in beta.

Have you tried falling back to using the v2 API?

https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-post

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events