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.
@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.
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
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?
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.
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.