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.
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
}
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Status 404 is returned if the customer request does not exist, maybe it is a cause..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Here is the Server/Data Center rest api
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.