How to generate JCMA plan migration reports and error logs zip files via a REST API call
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The following article provides guidance on generating Jira Cloud Migration Assistant(JCMA) migration reports and error logs files via REST API call.
Overview
The Jira Cloud Migration Assistant generates pre and post-completion reports that can be downloaded from JCMA by navigating to View details → Reports and logs tab. If, for any reason, the download link for the files is not displayed (possibly due to a zip file generation error or other reasons), it may be required to manually trigger JCMA to generate these files.
To generate the report using a REST API call, follow these steps.
Generate Reports and error logs using REST API
Get the Plan ID
To generate a downloadable link to these files, we need to get the plan ID of the migration plan.
- Go to JCMA (You can directly access the dashboard by visting <jira-base-URL>/secure/migration-app-action.jspa#/monitor)(example screenshot)
- Open the plan in the JCMA dashboard by clicking View details (example screenshot from the plan beckao test 1)
- Get the plan ID from the URL (highlighted in the example screenshot below)
Generate Pre/Post Migration Reports
Use the plan ID on the URL that'll generate the preflightCheckExecutionId, which is the id associated with the pre/post checks (URL format - replace the placeholders with your Jira Server base URL and the plan ID you got from the step above)
<jira-base-URL>/rest/migration/latest/plan/details/<plan ID>
A JSON response will be generated on the browser screen. Look for the preflightCheckExecutionId and copy its ID.
{ plan: { planId: "98d20a57-20cf-495f-8f2f-1aa67d3f3616", planName: "Plan Name", migrationType: "CLASSIC", preflightCheckExecutionId: "bd142b4731c1dada41f9e8d1139db459d5333263", cloudSite: { ... }
Use the preflightCheckExecutionId on the URL that'll force the generation of the pre-migration reports (URL format - replace the placeholders with your Jira Server base URL, the preflight check execution ID you got from the step above, and with a file name)
<jira-base-URL>/rest/migration/latest/report/<preflight check execution ID>/pre?planName=<file-name>
Use the preflightCheckExecutionId on the URL that'll force the generation of the post-migration reports (URL format - replace the placeholders with your Jira Server base URL, the preflight check execution ID you got from the step above, and with a file name)
<jira-base-URL>/rest/migration/latest/report/<preflight check execution ID>/post?planName=<file-name>
- A download prompt will pop up, for you to download the zip file
- Save the files and send it over to the Atlassian Support
Generate Error logs
Using REST API Calls
Use the plan ID on the URL that'll force the generation of the zip file with the JCMA plan errors (URL format - replace the placeholders with your Jira Server base URL and the plan ID you got from the step above)
<jira-base-URL>/rest/migration/latest/plan/<plan ID>/logs
- A download prompt will pop up, for you to download the zip file
- Save the file and send it over to the Atlassian Support
Using CURL request
This is just an example - you can use this API call with other applications as well (replace the placeholders for the user/password, Jira Base URL and plan ID
curl -s -u <user>:<password> -o plan-logs.zip https://<jira-base-URL>/rest/migration/latest/plan/<plan ID>/logs
A file called plan-logs.zip will be saved on the directory where you ran the command.