Forums

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

Adding label and comment through API only adds label

Jos Brunink
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!
June 18, 2025

I'm trying to edit an issue by using the v3 API.  

I want to add a comment and a label.

Documentation states i use the issue edit endpoint so i'm executing a PUT method on 

https://<api_url>/rest/api/3/issue/<ISSUE_ID>

With following body

{
    "update": {
        "labels": [
            {
                "add""CLEAR"
            }
        ],
        "comment" : 
        [
            {
                "add"
                {
                    "body":
                    {
                        "version":"1",
                        "type""doc",
                        "content":
                        [
                            {
                                "type":"paragraph",
                                "content":
                                [
                                    {
                                        "text":"TestCleared",
                                        "type":"text"
                                    }
                                ]   
                            }
                        ]
                    }
                }
            }
        ] 
    }
}
Result is 204 No Content which should indicate the request was succesfull.
This results in the label being added but the comment is not shown. 
Using the https://<api_url>/rest/api/3/issue/<ISSUE_ID>/comment endpoint does work but this does not allow me to add the label. 
Any help is greatly appreciated.

1 answer

1 accepted

3 votes
Answer accepted
Chitra Nagdeo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2025

Hey @Jos Brunink ,

Welcome to Atlassian Community, thank you for your query!

I understand on a single API call/request you want to add a comment and update Label field for a Jira workitem. Please refer below API documents related to Jira Software cloud

Jira Cloud's REST API does not allow adding a comment and a label to an issue in a single API callYou need to use separate API calls for adding a comment and updating labels. 
This is because both Label and workitem comments make use of seperate end-points/Resources.

How to achieve this:

  • Add a comment:
Use the Jira Cloud REST API to add a comment to an issue. This is done by sending a POST request to the /rest/api/3/issue/{issueIdOrKey}/comment endpoint with the comment content in the request body.
  • Update labels:
To update the labels of an issue, you would send a PUT request to the /rest/api/3/issue/{issueIdOrKey} endpoint. In the request body, you would specify the fields you want to update, including the labels.
Since these actions require different endpoints and request bodies, they cannot be combined into a single API call. However, you can automate these actions using Jira Automation or a script that sequentially makes these API calls.
Thanks and Regards
Chitra Nagdeo
Atlassian Cloud Support
ATLASSIAN

Suggest an answer

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

Atlassian Community Events