Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

How to set jsdPublic flag to false while adding a comment using rest API

jay
Contributor
August 29, 2024

I am not able to set jsdPublic flag to false when I add comment to an issue using the REST API. pls share the JSON body.

url: 

 

/rest/api/3/issue/{issueIdOrKey}/comment

1 answer

1 accepted

1 vote
Answer accepted
Sadiq Satriya August 30, 2024

Hi @jay ,

Using the Add Comment endpoint (/rest/api/3/issue/{issueIdOrKey}/comment), I was able to get it to work by adding this `properties` attribute:

{
  "properties": [
    {
      "key": "sd.public.comment",
      "value": {
        "internal": true
      }
    }
  ],

  "body": {
    "version": 1,
    "type": "doc",
    "content": [
      {
        "type": "paragraph",
        "content": [
          {
            "type": "text",
            "text": "This is a Private comment."
          }
        ]
      }
    ]
  }
}

I found this property by adding an internal comment through the UI, and inspecting the network calls - but I can't seem to find any official documentation on this property.

 


Alternatively, you could also use the Create request comment endpoint (/rest/servicedeskapi/request/{issueIdOrKey}/comment), which is a service-desk specific API. I've tested this body and it works as expected.

{
  "body": "This is a private comment.",
  "public": false
}

 

jay
Contributor
August 30, 2024

@Sadiq Satriya  Thank you it worked well. Thank you for your support and effort. I have a small doubt regarding the comments. 

I have an issue and I added 5 comments already in it. After that I moved the issue from "in-progress " to "resolved" state transition and along with that I added a  comment too using REST API.  I have added a comment during one transition from one state to another state. But that comment also added as a normal comment in JIRA.  But now when I fetch the issue details I am getting these 6 comments(old 5 comments + Resolved comment) together. What I want is I am looking for a solution to find the comment which I added during the transition(Resolved comment) using REST API only. is there any way?  Or is there any way to identify which is resolved comment from that list?

 

Suggest an answer

Log in or Sign up to answer