In this article, we will discuss how to create an OAuth2.0 application in your instance of Jira. This step is a prerequisite to using Jira to create a Virtual Collection in Totango.
Create a Connected App
In order to create a connected app for your Jira instance, you must be an admin of your Jira. The following steps will help you create a private connected app, which can be used inside your instance.
- Browse to developer.atlassian.com and log in using your admin user
- Click on your Initial name icon and select 'Create App'
- Give your App a name, agree to the terms, and click 'Create'.
- Copy the Client ID and the Secret (we will use them in Totango to set the connection).
- Click on the 'Oauth 2.0 (3LO) and update the Callback URL to https://app.totango.com/auth/das/callback
- Under 'API And Features' Click '+ add' Jira platform REST API
Click 'Configure' and make sure 'View Jira issue data(read:jira-work)' is added
Your Connected App is ready to use. Remember, this is an internal app that allowed you to connect to your Jira only (based on your user).
Setting up the virtual collection in Totango
To retrieve data from Jira, we are using the rest/api/2/search API. First, you will need to get your Jira Cloud Id. To do so, select the connection, set the API Query to https://api.atlassian.com/oauth/token/accessible-resources, and copy the cloud Id from JSON response (click on 'View JSON Response').
Use the cloud Id and set the API Query to https://api.atlassian.com/ex/jira/<CLOUD_ID>/rest/api/2/search?jql=<JBL SEARCH>
- replace the <CLOUD_ID> with your Cloud Id.
- Replace the <JBL SEARCH> with the search query (you can learn more here).
- For main objects use issues
- Use the following mappings (this is just an example, each Jira will have its own fields settings):
- key: Jira issue key
- fields.issuetype.name: issue type
- fields.priority.name: Jira issue priority
- fields.summary: Jira issue Title (Summary)
- fields.reporter.displayName: Reporter name
- fields.customfield_10010._links.agent: link to Jira issue (use this for external link)