I am trying to read issue details (both from Jira Software and JSM). What are the required scopes for this.
Welcome to the Atlassian developer community @SureshkumarS,
Scopes are listed in the docs for each REST API endpoint. For example, the Get issue endpoint lists:
Classic RECOMMENDED:
read:jira-work
Granular:
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
Thank you @ibuchanan. That worked like a charm. Also, I have a Python script utilizing the generated bearer Token. How long is this token valid?
To get a refresh token in your initial authorization flow, add offline_access
to the scope parameter of the authorization URL. Once you have the refresh token, exchange it for an access token by calling the token URL.
Can you elaborate the above step? Not sure where how to generate the initial refresh token to generate the refresh token?
curl --request POST
–url ‘https://auth.atlassian.com/oauth/token’
–header ‘Content-Type: application/json’
–data ‘{ “grant_type”: “refresh_token”, “client_id”: “YOUR_CLIENT_ID”, “client_secret”: “YOUR_CLIENT_SECRET”, “refresh_token”: “?” }’
I need to know how to generate the value mentioned as ? above.
Also, I am not sure how to add offline_access
to the scope.
Forgot about the above questions. I managed to setup the refresh token setup on my code. Still the token expires after an hour.
Yes, but if you securely store the refresh tokens, you can use those to refresh the access token. Did you end up using an OAuth library in Python? I’m curious which one?
I tried requests_oauthlib