Skip to content

Fix: declare missing read:group:jira and read:user:jira scopes for Cloud app#435

Open
G0m3e wants to merge 1 commit into
shridhar-tl:master-oldfrom
G0m3e:fix/missing-group-scope-cloud-app
Open

Fix: declare missing read:group:jira and read:user:jira scopes for Cloud app#435
G0m3e wants to merge 1 commit into
shridhar-tl:master-oldfrom
G0m3e:fix/missing-group-scope-cloud-app

Conversation

@G0m3e

@G0m3e G0m3e commented May 12, 2026

Copy link
Copy Markdown

Summary

Fixes #342 and #385.

On the Cloud (Forge) build of Jira Assistant, adding a Jira group from Settings → User Groups → Add group → Add Jira Group fails with:

Unknown error — Unable to pull user list from group. Look at console log for more details.

The browser console / Network tab shows the underlying call to /rest/api/2/group/member returning:

{"code":401,"message":"Unauthorized; scope does not match"}

Root cause

/rest/api/2/group/member is invoked from JiraService.getGroupMembers via requestJira. According to the Atlassian Cloud REST API docs, this endpoint requires the following granular OAuth 2.0 scopes:

  • read:group:jira
  • read:user:jira
  • read:avatar:jira

The current manifest.yml only declares read:avatar:jira, so the Atlassian API gateway rejects the request before it ever reaches Jira.

The picker call /rest/api/2/groups/picker is unaffected because it only requires read:group:jira or the classic read:jira-user (which is already declared). This explains why the autocomplete search works but the confirm step fails — exactly the symptom users have been reporting.

Fix

Add the two missing granular scopes to manifest.yml:

- read:group:jira
- read:user:jira

read:avatar:jira is already declared, so no change is needed there. No JavaScript code is modified.

Notes for maintainers / users

  • This is a manifest-only change.
  • Existing site installations will need to be upgraded (forge install --upgrade --site …) and the site admin must Accept the newly-requested scopes in Apps → Manage your apps → Review scopes, otherwise the upgraded install will continue to use the old scope set and still 401.
  • Consider also adding an explicit 401 branch to UserGroup.jsx's addNewGroup catch so future scope mismatches show a more actionable error instead of "Unknown error" — happy to do this in a follow-up PR if desired.

Test plan

  • Deploy the patched build to a private dev app via forge deploy
  • forge install --upgrade --site <test-site>.atlassian.net and accept the new scopes
  • Open Jira Assistant → User Groups → Add group → tick Add Jira Group → pick a group → confirm ✓
  • Group is added and member list is populated correctly
  • Picker autocomplete (/groups/picker) still works
  • No regression on the browser-extension build (manifest.yml is not bundled there)

Fixes shridhar-tl#342, shridhar-tl#385.

On the Cloud (Forge) build, adding a Jira group from User Groups
fails with 'Unknown error - Unable to pull user list from group'.

Root cause: when calling /rest/api/2/group/member through requestJira,
the Atlassian API gateway returns:
  {"code":401,"message":"Unauthorized; scope does not match"}

Per the Atlassian docs, that endpoint requires the granular OAuth
scopes read:group:jira, read:user:jira and read:avatar:jira.
Only read:avatar:jira was declared, so the request was rejected.

Declaring the two missing scopes fixes the searchGroups picker
and the subsequent getGroupMembers call used by Add Jira Group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When adding users under user groups, it throws error saying that "One or more of the actions failed .Look at the console for more details"

1 participant