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 Jira connection in Totango, you need a Jira Client ID and Client Secret. Please follow these steps:
Got to JIRA Developer application: https://developer.atlassian.com/
Click on the user icon (in the top right corner) and choose “Developer console”
Click “Create app” and choose “OAuth 2.0 (3LO) integration”
Add application name (“Totango” for example), agree with Atlassian terms, and click on Create button
Go to the “Permissions” tab, Add “Jira API” and click "Configure" to add the scopes:
Note: If you don't see the Jira API row, you may need to tell Jira to show you the new permissions.
Click on the “Edit Scopes” button and add the following Scopes:
Go to the “Authorization” tab and set up the Totango call back URL: “https://app.totango.com/auth/das/callback”
Go to "Settings" and Copy the Client ID and Secret. Paste them in the Totango Connection window
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)