The forms REST API provides a set of operations that enables you to export forms in xlsx
format. This
tutorial will guide you through the steps required to complete the export process.
Export requests must specify a corresponding template form and project. To export instances of multiple different template forms, you will need to follow this process for each.
Get started by sending a request to the start export operation
that will begin the export process. Below is an example that uses basic auth to initiate an export in xlsx
format.
1 2curl --request POST \ -u <your_email@domain.com>:<your_user_api_token> \ --url 'https://api.atlassian.com/jira/forms/cloud/<cloudid>/export' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "format": "xlsx", "projectIdOrKey": "PROJ-1", "templateFormId": "c18bde7a-d846-11ed-afa1-0242ac120002" }'
You should then receive the following response or similar.
1 2{ "format": "Xlsx", "id": "responses-xlsx-10000-0-0000000000", "statusUrl": "https://api.atlassian.com/jira/forms/cloud/<cloudid>/export/responses-xlsx-10000-0-0000000000" }
Remember to note the returned id
as you will need it to complete the following steps.
You may specify additional Jira fields that you wish to be included in the export, and a JQL query can be provided to narrow down the set of matching issues to export forms from.
To specify these parameters, simply include them in the request body. Below is an example that includes the contents of "description" and "summary" Jira fields and limits the export to issues created within the last 30 days.
1 2{ "format": "xlsx", "projectIdOrKey": "PROJ-1", "templateFormId": "c18bde7a-d846-11ed-afa1-0242ac120002", "fields" : ["description","summary"], "jql" : "created >= -30d" }
Exporting may take some time to complete depending on the size of the export. To check the status, you may call the get export status operation. You will need the export id returned to you in the first step’s response.
1 2curl --request GET \ -u <your_email@domain.com>:<your_user_api_token> \ --url 'https://api.atlassian.com/jira/forms/cloud/<cloudid>/export/responses-xlsx-10000-0-0000000000' \ --header 'Accept: application/json'
You'll then receive a response indicating the progress of the export. If the export is complete, it may be downloaded.
1 2{ "complete": true, "failed": false, "progress": 100 }
Completed exports may be downloaded by calling
the download export result operation. You must
specify a filename for the export as a URI parameter. For example to download the above export to a file called
export.xlsx
:
1 2curl --request GET \ -u <your_email@domain.com>:<your_user_api_token> \ --url 'https://api.atlassian.com/jira/forms/cloud/<cloudid>/export/responses-xlsx-10000-0-0000000000/export.xlsx' \ --header 'Accept: application/json'
The API will return a 404 NOT FOUND
response if the export has not completed, failed, or the filename provided is
invalid.
Rate this page: