Hi Community,
We are migrating from the deprecated /rest/api/3/search
endpoint (Basic Auth + API token) to the new /rest/api/3/jql/search
endpoint which requires OAuth 2.0 granular scopes.
Here’s what we’ve done so far:
Created an OAuth 2.0 (3LO) app in the Atlassian developer console.
Requested granular scopes:
read:jql:jira
validate:jql:jira
Completed the consent flow using the authorization URL with these scopes.
Successfully exchanged the code for an access token.
When decoding the access token, we do see:
"scope": "read:jql:jira validate:jql:jira"
However, when we try to call the JQL endpoint:
POST https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/jql/search Authorization: Bearer <access_token> Content-Type: application/json { "queries": [ { "query": "project = TEST AND created >= -7d", "maxResults": 5, "fields": ["key", "summary", "status"] } ] }
We still get this error:
{"code":401,"message":"Unauthorized; scope does not match"}
Questions:
Are read:jql:jira
and validate:jql:jira
the correct scopes for using the new JQL API?
Should we remove legacy scopes (like read:jira-work
) completely and only use granular scopes?
Why does the token show the correct scopes but the request still fails with Unauthorized; scope does not match
?
Is there any migration guidance specific to JQL and granular scopes beyond the changelog note (CHANGE-2046)?
Welcome to the community.
All scopes mentioned in the API endpoint are required.
So all these are needed:
@Marc - Devoteam So, should we use a mixture of granular and legacy scopes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, according to the API documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.