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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,641,216
Community Members
 
Community Events
196
Community Groups

Create Internal Comment using REST API for Jira Service Desk Server

Trying to create an internal comment on an issue using the REST API. We use Jira Service Desk Server version 7.7.0

I have tried sending the body JSON format below and can't get this to work...

{
"body": "Test internal comment",
"properties": {
"key": "sd.public.comment",
"value": {
"internal": true
}
}
}

 

Sending the POST request without the "properties" key/value add's the comment to the issue no problems but it is a public comment.

Any help on this would be appreciated, thank you.

3 answers

Hi @Matt Weick You can use same API to post internal comment on issue. Just wrap "properties" in array node. Refer below code snippet.

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

Awesome! This one worked.

Hello,

As described in documentation, You need to make a POST method call to the endpoint /rest/servicedeskapi/request/{issueIdOrKey}/comment with a body like: 

{ "body": "Hello there", "public": true }

 To make an internal comment just change the value of public property to false like here:

{ "body": "Hello there", "public": false}

It worked in my case, I hope that it will be the same in your case.

Thanks to @Alexey Matveev with the API Browser, I was able to see that the "/rest/servicedeskapi/" methods are Private REST APIs only. I am trying to make the call from a different application, this would explain why I am getting 404 not found. 

Is there a way to make POST "/rest/servicedeskapi/request/{issueIdOrKey}/comment" a public API?

Status 404 is returned if the customer request does not exist, maybe it is a cause..

I posted the request I am making above in reply to @Alexey Matveev above. I believe I have figured this out though, it appears that if the Issue does not have a "Request Type" selected, the API calls won't work. I just defined a "Request Type" for the Issue I was testing with and it added the internal comment on the Issue via the REST call.

Some Issues that we have might not have a Request Type defined on the Issue, do you know if it's possible for this to work without having a Request Type selected on an issue?

Like Sandy Duchemin likes this

Hi, got a doubt here..
Is it sure that if the issue does not have a "Request Type" selected, the API calls won't work and internal comments can't be created?

0 votes
Alexey Matveev
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.
Jul 31, 2018

Hello,

Try to use ServiceDesk Rest Api for it. You can find more info here:

https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-request-issueIdOrKey-comment-post

We have the server edition of Jira Service Desk (we host it in our data center), the doc you reference here I believe is only for the cloud edition of Service Desk because I already tried that before posting this and the response is always 404 not found.

Alexey Matveev
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.
Aug 01, 2018

Still getting 404 not found when trying "https://servicedesk.company.com/rest/servicedeskapi/request/ISSUE-#/comment"

The "/rest/api/" and "/rest/api/2/" methods all work but can't figure out how to set them as internal comments. Do I have install/enable something in order to get "/rest/servicedeskapi/" methods to function?

Alexey Matveev
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.
Aug 01, 2018

You can install the Rest Api Browser. It will help you to work with Rest Api, which is available in Jira. It is a free add-on. 

https://marketplace.atlassian.com/apps/1211542/atlassian-rest-api-browser

Does this include the "/rest/servicedeskapi/" methods ?

Alexey Matveev
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.
Aug 01, 2018

It will let you see all rest api methods you have in your Jira. /rest/servicedeskapi is installed with Jira Service Desk. If you have the Jira Service Desk application installed, then the rest api is there. You can find it with the Rest Api Browser.

Alexey Matveev
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.
Aug 01, 2018

Private and Public does not matter. It is still can be called from outside. It means you are doing the wrong call from your external application. 

This is the exact call I am making:

POST  https://support.domain.com/rest/servicedeskapi/request/ISSUE-100/comment

JSON Body:

{
"body": "Test internal comment",
"public": false
}

 This returns a 404

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events