Jira/Forge Project page with Custom UI asks for permissions every time

Hi guys,

Sharing my update in case your issue was similar to mine.
I am fairly new in Jira app development so this might help new jira app dev as well.

Having the Custom UI asking for permission was coming from a miss match in authorization vs app permission needed.

The app was authorized with a set of permission but after an update I was using more than allowed permission and failed to update the manifest properly.

I was able to get a better error message by implementing a fallback check rather and skipping the “allow access” button.

Message was as follow:
{“code”:401,“message”:“Unauthorized; scope does not match”}

Pretty clear now what was happening in my situation.

Updating the Permission scope in Manifest fixed it.

Example:

permissions:

scopes:

# Platform / projects (project search, browse).*

- read:jira-work

- read:project:jira

# GET /rest/api/3/project/.../versions and GET /rest/api/3/version/{id}*

- read:project-version:jira

# GET /rest/agile/1.0/board and board/{id}/sprint --- classic read:jira-work does not satisfy Agile REST.*

- read:board-scope:jira-software

- read:sprint:jira-software

# Agile GET .../board/{id}/sprint/{id}/issue requires read:jql:jira (Jira Software REST docs).*

- read:jql:jira

# Issue changelog, field metadata, and project status -> category (for "Done" at sprint end).*

- read:issue-details:jira

# GET /rest/api/3/issue/{key}/changelog --- granular scope per platform REST docs.*

- read:issue.changelog:jira

- read:field:jira