Forge app - Accessing Jira Service Management customer

Hello.
I am trying to get customer data using this API: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-get

I use @forge/api for this

await api.asUser().requestJira(`/rest/servicedeskapi/request`)

But I get the following error:

errorMessages ": [" Your app does not have scopes that are required to access this method ('read: servicedesk-request'). "]

I cannot figure out how I can set the OAuth scope ‘read: servicedesk-request’

Can anyone offer some help or examples of code retrieving customer data?

Can you share what scopes you currently have in your manifest?

scopes:

permissions:
  scopes:
    - read:jira-work
    - storage:app

@bentley , we’re encountering the same issue.
Is this a bug? Or are we doing something “wrong” in our implementation?

Curious was this working previously and stopped?

If not, then I think this might be a “vaguely mis-documented” issue…

The Forge Product API docs (https://developer.atlassian.com/platform/forge/product-rest-api-reference/) say:

To call a product REST API using the Authenticated Product Fetch APIs the operation must support OAuth 2 authentication. In the product API documentation, this is shown by the OAuth scopes required field, which documents the required OAuth 2 scope for that operation.

Calling an unsupported operation with asUser() returns a 401 error.

Note, Jira Cloud REST API version 2 is not supported by the forge lint command. Only /rest/api/3 paths are supported.

Cool cool. So we need to make sure the JSM API documentation says whether OAuth 2.0 is supported.

But then the product docs (https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-get) say:

App scope required : READ

OAuth scopes required : read:servicedesk-request

And clicking on App scope takes me to a page titled Scopes for Connect and OAuth 2.0 (3LO) apps which sounds like OAuth 2.0 is supported.

Maybe related issue? Forge app - Accessing Jira Service Management project issue

@bentley - in our case, this is a first attempt at this, so don’t know if this was working before.

Agreed on documentation. It’s rather confusing the way things are worded, as the JSM docs say:
OAuth scopes required : read:servicedesk-request

But there is no indication anywhere whether Forge would support this, especially since Forge itself simply throws an error saying this scope is needed.

I’m hoping someone from the Forge team can chime in on this.

1 Like

I’ve learned that JSM scopes are not yet included here: https://developer.atlassian.com/platform/forge/manifest-reference/permissions/#jira-cloud-platform

So accessing JSM will not work yet.

Thanks @bentley for checking on this.

1 Like