We are building service that provides users with an option to backup their data from different applications. We saw applications that used the way to insert their websites as an iFrame and automatically authorise user’s Jira account in their services.
To follow the same way as those apps, we’ve created Forge app with type Custom UI on admin page on Admin page. I need to get access token user from the scope in the app.
read:me read:account read:jira-user read:jira-work write:jira-work manage:jira-webhook manage:jira-project manage:jira-data-provider manage:jira-configuration read:board-scope:jira-software write:project:jira read:board-scope:jira-software read:board-scope.admin:jira-software read:sprint:jira-software read:servicedesk-request manage:servicedesk-customer write:servicedesk-request read:servicemanagement-insight-objects read:issue-details:jira read:jql:jira wr
Based on the Forge app documentation, this permissions are set up in the manifest.yml file
permissions:
scopes:
- read:me
- read:account
- read:jira-user
- read:jira-work
- write:jira-work
- manage:jira-webhook
- manage:jira-project
- manage:jira-data-provider
- manage:jira-configuration
- read:board-scope:jira-software
- write:project:jira
- read:board-scope:jira-software
- read:board-scope.admin:jira-software
- read:sprint:jira-software
- read:servicedesk-request
- manage:servicedesk-customer
- write:servicedesk-request
- read:servicemanagement-insight-objects
- read:issue-details:jira
- read:jql:jira
- write:sprint:jira-software
- read:project:jira
- read:issue:jira
However, all my requests to endpoints with permissions that I shared above don’t work. I’m getting lack of permissions error. Here is an example of the request:
import Resolver from '@forge/resolver';
import api, {route} from "@forge/api";
const resolver = new Resolver();
resolver.define('getText', async (req) => {
console.log(req)
const response = await api.asUser().requestJira(route`/rest/api/3/project/search`);
if (!response.ok) {
throw new Error(`Error: ${response.status} ${response.statusText}`);
}
const data = await response.json();
console.log('data', data);
return data;
});
export const handler = resolver.getDefinitions();
Can you please help me with this error and possible ways how I can handle this?