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?

1 Like

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

Hello @bentley, is there any ETA regarding JSM scopes?

I don’t have any specifics, but I’ve flagged JSM availability as a topic that would be great to cover during this event: https://atlassian.zoom.us/webinar/register/WN_qNSgV1lARfCeB2UqIwLunA.

1 Like

@bentley Thank you for the hint. We’ll gladly attend this event.

are there any news on accessing Jira Service Management from forge in some way? I would hate to use connect for my app just because of that… Workarounds are fine as long as they are secure

2 Likes

Could you confirm if this is possible by now? I don’t know if I’m doing something wrong or if this is simply not possible. I’m trying to get data from Insight with Forge with no success. Looking at the API documentation it looks like it should be possible?

@LeroyElendt,

No. For one, to my knowledge, it is not yet possible for Forge to surface on the customer portal for “unauthenticated users” (ie customers who aren’t users/agents in Jira). For another, Insight APIs are not yet supported by Forge, regardless of “unauthenticated users”. The only way to access Insight APIs is via API tokens.

1 Like

I’m trying to get data from Insight with Forge with no success

I’d recommend use Insight Rest API so you can use IQL for getting assets.

No. For one, to my knowledge, it is not yet possible for Forge to surface on the customer portal for “unauthenticated users”

Using Forge’s latest version you can customize JSM by using the available following modules:

  • Jira Service Management organization panel
  • Jira Service Management portal footer
  • Jira Service Management portal header
  • Jira Service Management portal profile panel
  • Jira Service Management portal request detail
  • Jira Service Management portal request detail panel
  • Jira Service Management portal request view action
  • Jira Service Management portal subheader
  • Jira Service Management portal user menu action
  • Jira Service Management queue page

Hello @bentley, is there any ETA regarding JSM scopes?

Now you can use Jira Service Management Cloud scopes for OAuth 2.0 (3LO) and Forge apps

I’ve tested :
const res = await api.asUser().requestJira(route'/rest/servicedeskapi/servicedesk/<<PROJECT-KEY>>/organization') on Forge 4.5.0 to get JSM organization names and works like charm.