Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.
This article describes how to configure an OAuth app (3LO) in Jira App management, token generation and configuring an account in webMethods.io workflow
Login to Log in with Atlassian account
Click on “Create New App” on the top right corner
Name your app and tick the checkbox “I agree to be bound by Atlassian’s developer terms.”
Click on “Add” and add all the APIs required. For our use case we need to add “Jira Service Desk API” and “Jira Platform REST API”
Select API from “APIs and Features” on left pane and add all the scopes required.
Select “OAuth 2.0 (3LO)” from “APIs and Features” on the left pane and add callback URL and save changes. For our use case add https://tech.forums.softwareag.com as a callback URL
Get Authorization code
https://auth.atlassian.com/authorize?audience=api.atlassian.com&client_id=YOUR_CLIENT_ID&scope=REQUESTED_SCOPE_ONE%20REQUESTED_SCOPE_TWO&redirect_uri=https://YOUR_APP_CALLBACK_URL&state=YOUR_USER_BOUND_VALUE&response_type=code&prompt=consent
Where,
Add “offline_access” to get refresh_token in next step
Recommended scopes: manage%3Aservicedesk-customer%20read%3Aservicedesk-request%20write%3Aservicedesk-request%20read%3Ajira-user%20read%3Ajira-work%20manage%3Ajira-project%20manage%3Ajira-configuration%20write%3Ajira-work%20manage%3Ajira-data-provider%20offline_access (This will get access token for both Jira software and Jira Service desk )
ex: 494954955989
(Read documentation for more details https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/#faq3 )
Form the URL and enter it in any browser and authorize to get the code by clicking accept. Since the redirect URI was https://tech.forums.softwareag.com/ it’s redirected us to Software AG Tech Forums with our code. Code can be found in the URL as query string parameter.
Make a POST call from POSTMAN
https://auth.atlassian.com/oauth/token
body:
grant_type = authorization_code client_id = Create an app from App Management and get the client_id client_secret = Create an app from App Management and get the client_secret code = Code obtained from step 7 (Get Authorization code) redirect_uri = set same redirect URI which is set in the App created
grant_type = refresh_token client_id = Create an app from App Management and get the client_id client_secret = Create an app from App Management and get the client_secret refresh_token = Obtained from step 8 ( Get Access_token and refresh_token )
Make a GET call from POSTMAN
https://api.atlassian.com/oauth/token/accessible-resources
Authorization = Bearer "Obtained access_token" Accept = application/json
Client ID, Client secret, Access Token, Refresh Token, Refresh URL Grant type = refresh_token Server URL = https://api.atlassian.com/ex/jira/<cloud-id> Where <Cloud-id> is obtained from step 10
Great post, learned a lot.
Hi,
I always get the following error message “Unknown or invalid refresh token” after a certain time. With Postman everything works without problems. What could be the problem?
Thanks. Regards, Yannick
Updated label to knowledge base.
Regards, Bharath