Forge app - Accessing Jira Service Management project issue

Hi
I am exploring forge. I’ve adapted some of the example apps to pull some data from Salesforce and present it in a table in an Issue Panel.

My next step is to use some of the issue’s custom field values to send requests to Salesforce API.
I am using the code below to retrieve the issue data.

  async function getIssueData() {
    // Fetch issue fields to translate from Jira
    console.log(`/rest/api/3/issue/${issueKey}`);
    const issueResponse = await api.asApp().requestJira(`/rest/api/3/issue/${issueKey}`);
    await checkResponse('Jira API', issueResponse);
    const issuedata = await issueResponse.json();
    return issuedata;
  }

This is working fine with a Jira Software project. But when I use the app on a Service Management project is fails with a 404 error.

“There was an error invoking the function - Error from Jira API: 404 {“errorMessages”:[“Issue does not exist or you do not have permission to see it.”],“errors”:{}}”

I am sure the API key is valid as it works for Jira Software Projects, and my user account associated with the key can access and browse the Jira Service Desk project through the web UI and can retrieve issues using Postman and the REST API.

I’ve also tried the Forge Issue Translator example app and it appears to have the same problem when used on the Jira Service Desk project.

Does Forge support retrieve issue data from a service desk project? Can anyone offer some help or examples of code retrieving issue data?

UPDATE: I tried installing the app on another cloud site. This time it worked with a JSD project. I was able to retrieve the issue.

I then checked the permission schemes in Site A (not working) and Site B (working). I found that in Site B, I had a permission scheme in the JSD project which provided Browse Project permissions to anyone with a JIRA Software license.

I applied the same permissions in Site A and I was able to read the issue.

Why do I need a JIRA Software license to read an issue in a Jira Service Desk project. This doesn’t make sense to me?

I added more code to update the JSD issue. But this fails with the error “customfield_XXXXX cannot be set. It is not on the appropriate screen or is unknown”. I’ve verified that the field is on all screens and can update this field using the same API call from Postman.

I suspect that either JSD projects are not yet supported properly in Forge, or there is something wrong with the Oauth authentication.

Can anyone help?
Thanks
Chris

Hi @chrdunne,

Sorry for the late reply. We have a follow up question to better understand where the problem lies. How the browse project permission is given to the user on site A e.g. through role/application-access/group? If it is possible to attach screenshots of permission scheme it would be perfect.

We are returning 404 in case user lacks browse permissions so we’d like to double check whether this is the case for the site A.

Thanks,
Vitalii

Hi

Here is the permission scheme that causes the error


Also, my account is in both the Administrator and Service Desk Team roles.

If I add the Application Access role, Jira Software, I do not get the error

Thanks for your help.
Chris

1 Like

Thanks, Chris! I’ll pass this info further to investigate the root cause.