Import Jira Data to Google Sheets
Jira is a popular bug tracking and development tool from Atlassian. In this guide, we’ll walk through how to pull data from the Jira REST API directly into Google Sheets, using the API Connector add-on for Sheets. We’ll first get an API key from Atlassian, and then set up a request to pull in user data to your spreadsheet.
- Part 1: Get your Jira API Key
- Part 2: Create your API Request URL
- Part 3: Pull JIRA API API Data into Sheets
- Part 4: More Example API URLs
- Part 5: Handle Pagination
PART 1: GET YOUR JIRA API KEY
- While logged into your Jira account, navigate to https://id.atlassian.com/manage/api-tokens and click Create API token.
- A modal will appear, prompting you to give your token a name. You can name it anything, but for this example we’ll name it ‘Google Sheets’. Click Create.
- You’ll now see a new modal containing your API token. Copy this to your clipboard as you’ll need it in a moment.
- One last step: Because the Jira API requires Basic Authentication, we need to encode our authentication info to base 64. You can do this by entering your your credentials in the format
useremail:api_tokeninto this form. Your encoded credentials will appear underneath.
The encoding script runs in your browser, and none of your credentials are seen or stored by this site.(If you have any problems with the above, please check this post for some alternate methods of encoding your credentials).
PART 2: CREATE YOUR API REQUEST URL
We’ll follow the Jira cloud platform documentation to access a list of your projects.
- API root: https://your-domain.atlassian.net
- Endpoint: /rest/api/3/project/search
Putting it together, we get the full API Request URL:
PART 3: PULL JIRA API DATA INTO SHEETS
We can now enter our values into API Connector and import Jira API data into Google Sheets.
- Open up Google Sheets and click Add-ons > API Connector > Open.
- In the Create screen, enter the Request URL we just created
- Under Headers, enter a set of key-value pairs, like this:
Authorization Basic YOUR_ENCODED_STRING Content-Type application/json
Replace YOUR_ENCODED_STRING with your encoded string from part 1, step 4.
- Create a new tab and click ‘Set current’ to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see a list of your Jira projects in your Google Sheet:
PART 4: MORE EXAMPLE API URLs
You can check the documentation for the full list of available API requests, but if you just want to jump in, you can play around with the URLs you enter in the API URL path field. Try the following (one at a time):
(replace’DEMO-1′ with your own issue ID).
PART 5: HANDLE PAGINATION
- By default Jira limits the number of results in a single response (usually to 50 records) as described here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#pagination. To get more records, you can add the
maxResultsparameter to the end of your URL, with a value up to 100. If you still need to retrieve additional records after that, you would page through the records with the
startAtparameters, like this:
- In API Connector you can run these paged requests separately, or loop through them automatically using pagination handling (paid feature). Jira provides the complete next page URL in a field called “nextPage”, so it would be entered like this: