Forums

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

Close an issue using the v3 API

Cyberlogic Integration User June 24, 2022

Im using the following body to close a ticket via REST API v3
Found here : https://community.atlassian.com/t5/Jira-questions/Close-Jira-Issue-via-REST-API/qaq-p/1845399

This is my POST URL
https://*****.atlassian.net/rest/api/3/issue/CIT-3/transitions?expand=transitions.fields



{
        "update": {
            "comment": [
                {
                    "add": {
                        "body""Resolved via automated process."
                    }
                }
            ]
        },
        "transition": {
            "id""761"
        },
        "fields": {
            "resolution": {
                "name""Done"
            }
        }
    }
Im getting an error 
        "comment""Operation value must be an Atlassian Document (see the Atlassian Document Format)"

What am I missing? 

1 answer

0 votes
Tansu Akdeniz
Community Champion
June 24, 2022

Hi @Cyberlogic Integration User 

Welcome to the community.

Can you please take a look at Jira Cloud Rest Api doc? (look at comment in a request)

Cyberlogic Integration User June 27, 2022

It does not specifically show me how to close issues.
I would like to just get the json to get this right. 

Tansu Akdeniz
Community Champion
June 27, 2022

What about using the following for comment in a body:

"comment": [
{
"add": {
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Resolved via automation.",
"type": "text"
}]}]}}}]
Cyberlogic Integration User June 27, 2022
Using the JSON above, i get this error.
{
    "errorMessages": [
        "Invalid request. Could not parse request body."
    ]
}

How would i close the ticket? So basically mark it as Done / Completed. 

Suggest an answer

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

Atlassian Community Events