I am trying to read jira issue via API.
I created PAT without scope and the API works fine.
curl -u jira_email:PAT_without_scope -X GET "https://my-jira-space.atlassian.net/rest/api/3/issue/issue-id"
I create PAT with scope and I get error message:
curl -u jira_email:PAT_with_scope -X GET "https://my-jira-space.atlassian.net/rest/api/3/issue/issue-id"
{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}%
Scope applied:
I am also having this exact issue - I have access to the project and issues in the GUI and can successfully post stories in our sandbox Jira environment, but I cannot get an issue in our production instance to be retrieved, I even tested it with a PAT made with only the scopes required for that 1 endpoint and it gave me the same error message in 2 different projects I have access to normally. Just this one endpoint is giving me issues
@Jamiu Adeleke Welcome to Atlassian Community!
API tokens with specific scopes are tied to OAuth 2.0 (3LO) and cannot be used directly with standard Jira REST API endpoints.
To use OAuth 2.0 tokens, you'll first need to construct the request using the appropriate resource URL that includes your Cloud ID, as outlined in the documentation:
🔗 Enabling OAuth 2.0 (3LO) for Atlassian Cloud
Your API endpoint should look like this:
https://api.atlassian.com/ex/jira/{cloudid}/rest/api/3/issue/{issueIdOrKey}
You can also retrieve the cloudid following the steps mentioned in this Atlassian guide.
Finally, you should include read:jira-work Classic scope to the token as recommended by others. A working curl command would look something like,
curl --request GET \
--url 'https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/issue/{issueIdOrKey}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Akash, I will check it again today.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamiu Adeleke Were you able to resolve the issue? If so, kindly mark my answer as accepted, it helps others in the community find the solution more easily.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jamiu Adeleke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community.
Can you access this issue via the GUI?
If not, the error is correct, because it means you don't have access to the issue in that project.
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.