Seven months ago, we successfully deployed a custom application to our Jira product. It is a relatively simple jira:issuePanel module that enables some software development workflows on some select jira issues.
Recently, the application started to fail. Some users did not have an issue, others did. One user with two accounts saw consistent failures with one account but not the other.
Last week I checked my development environment and also found that the app was failing for me.
On investigation it was realized this code was the issue:
response = await api.asUser().requestJira(route`/rest/api/3/myself`, {
headers: {
'Accept': 'application/json'
}
}),
result = await response.json();
For users with the issue, result contained the following:
{
"error": {
"message": "Authentication required",
"name": "NEEDS_AUTHENTICATION_ERR",
"serviceKey": "atlassian-token-service-key"
}
}
To be clear for many months there were no issues. But this error selectively appears for some users only.
FYI permission scopes in the manifest were:
- read:jira-user
- read:jira-work
- storage:app
An online search of this error code yielded interesting discussions, but no resolution.
The online documentation (https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-rest-api-3-myself-get) shows exactly what was implemented, and the recommended scope (read:jira-user)
One discussion thread suggested this was an issue with the Atlassian servers, so I waited a few days to see if the issue resolved itself. It did not.
Today I explored the documentation more and found this page: https://developer.atlassian.com/platform/forge/manifest-reference/scopes-forge/
It suggested three more scopes that on a whim I tried in my development environment:
- read:app-system-token
- read:app-user-token
- report:personal-data
Many thanks for your help here!