Hello, I want to bring all issues in Jira or certain issues with JQL through my application. I can get a single issue by sending a request as /rest/api/3/issue/T1-1. However, when I request /rest/api/3/search?jql=..., I get the error {“code”:401,“message”:“Unauthorized; scope does not match”}.
Here is my code below:
try {
if (issueIdOrKey === undefined || issueIdOrKey === null) {
response = await api.asUser().requestJira(route`/rest/api/3/search?`, {
headers: {
'Accept': 'application/json'
}
});
} else {
response = await api.asUser().requestJira(route`/rest/api/3/issue/${issueIdOrKey}`, {
headers: {
'Accept': 'application/json'
}
});
}
console.log(`Response: ${response.status} ${response.statusText}`);
return await response.json()
} catch (error) {
console.error('Error:', error);
throw error;
}
Here is my permissions below:
permissions:
scopes:
- 'read:jira-work'
- 'read:issue-meta:jira'
- 'read:issue-security-level:jira'
- 'read:issue.vote:jira'
- 'read:issue.changelog:jira'
- 'read:avatar:jira'
- 'read:issue:jira'
- 'read:status:jira'
- 'read:user:jira'
- 'read:field-configuration:jira'