Using Postman to comment via servicedeskapi

Hello,

I’m trying to POST a comment using a Bearer Token via Postman to:
https://api.atlassian.com/ex/jira/{cloud-id}/rest/servicedeskapi/request/{issue-id}/comment/

I get the following response:
{“errorMessage”:“The request type you are trying to view does not exist.”,“i18nErrorMessage”:{“i18nKey”:“sd.customerview.error.vpOriginMissing”,“parameters”:}}

If I change “request” to “issue” in the endpoint, I get the following response:
{“errorMessages”:[“OAuth 2.0 is not enabled for method: POST /rest/servicedeskapi/issue/{issue-id-redacted}/comment/”]}

What correction can I make to be able to make a comment via servicedeskapi?

Thank you for the help :slight_smile:

Hi @ChristopherCasares ,

This response can be returned if the issue you are trying to comment on using this service desk endpoint is a Company-managed software project instead of a Service management type. Can you double check the project type if that is indeed the case?

If you are to add comments to tickets (regardless of the project type), you might want to try out Add comment REST API.

Cheers,
Ian

Thanks for the response!
Whats the beast way to determine if the issue is a Company-managed software project instead of a Service management type?
And is there any documentation on servicedeskapi endpoint?

I see the documentation here:
https://docs.atlassian.com/jira-servicedesk/REST/3.9.1/#servicedeskapi/request/{issueIdOrKey}/comment-createRequestComment

Referencing:

As mentioned in my original post, it looked like I need to do something about the Request Type. What is the “Request Type” and where can I view it?

Hi @ChristopherCasares ,

You can use Get project REST API; this returns projectTypeKey wherein a value of service_desk refers to a service management type.

Yes, the cloud version can be referenced here.

This is the Jira service desk documentation for the server version only.

These can be seen as different categories/kinds of requests that can be raised on a service project, you can check this documentation for more information. In your original post, if you are using the service desk API to access a non-service desk project, then that could explain the “The request type you are trying to view does not exist.” error.

Hope this helps.

Ian

I have the same error when trying to pull the attachments in a comment by rest api.

In my case the project is definitely a service desk project:

“projectTypeKey”: “service_desk”,
“simplified”: false,
“style”: “classic”,
“isPrivate”: false,
“properties”: {}

and i receive this error:

{
“errorMessage”: “The request type you are trying to view does not exist.”,
“i18nErrorMessage”: {
“i18nKey”: “sd.customerview.error.vpOriginMissing”,
“parameters”:
}
}

when i call this api:
…/rest/servicedeskapi/request//comment/411411/attachment

I am a Site Admin and definitely have visibility for the ticket. I’m using the rest api with my user.

I do not understand what the error message is telling me.

Any suggestions welcome.

Welcome to the Atlassian Developer Community, @StuartWhite.

It is possible that the service desk request you are looking at does not have a request type like this sample
image

To verify using an API, you can use the Get issue endpoint and search for the text requesttype in JSON response (the customfield ID may vary). Mine looks something like this:

        "customfield_10010":
        {
            "_links":
            {
                ...
            },
            "requestType":
            {
                "_expands":
                [
                    "field"
                ],
                "id": "21",
                "_links":
                {
                    "self": "https://myinstance.atlassian.net/rest/servicedeskapi/servicedesk/2/requesttype/21"
                },
                "name": "Request admin access",
                "description": "For example, if you need to administer Jira.",
                "helpText": "",
                "issueTypeId": "10012",
                "serviceDeskId": "2",
                "portalId": "2",
                "groupIds":
                [
                    "8"
                ],
                "icon":
                {
                    "id": "10513",
                    "_links":
                    {
                        "iconUrls":
                        {
                            "48x48": "https://myinstance.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10513?size=large",
                            "24x24": "https://myinstance.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10513?size=small",
                            "16x16": "https://myinstance.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10513?size=xsmall",
                            "32x32": "https://myinstance.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10513?size=medium"
                        }
                    }
                }
            },
            "currentStatus":
            {
                "status": "Open",
                "statusCategory": "NEW",
                "statusDate":
                {
                    "iso8601": "2022-08-17T10:08:27+0800",
                    "jira": "2022-08-17T06:08:27.612+0400",
                    "friendly": "Today 10:08 AM",
                    "epochMillis": 1660702107612
                }
            }
        }

Hope this helps.

Ian

Hi Iragudo,

It’s so easy when you do it right.

I completely overlooked that Request Type was (in a hurry) not entered. However after adding it, it worked as expected.

Thank you!
Stuart

1 Like

You’re welcome, @StuartWhite.

Let’s hope the original poster was able to make it work, too :slight_smile:

Cheers,
Ian