How to Migrate Data With Attachments using Jira Command Line Interface
This article explains how to migrate data with attachments using Jira CLI.
Instructions:
Create a CSV file with issue data and execute CLI action which will create issues.
project,type,summary
ABC,Bug,Hello
ABC,Task,TestRun the below CLI to create an issue
--action runFromCsv --file test1.csv --common "--action createIssue --label "created-from-cli"Export all the issues that we created from the above action.
--action getIssueList --jql "labels = "created-from-cli"""" --columns "key,Summary"Construct a CSV file with the issue key and path to the attachment and execute the below CLI action with the constructed file. This approach is only for single attachments and for multiple attachments, we can make use of addAttachments with directory/folder paths where you have multiple attachments,
issue,file
ABC-62,"/Users/appfireuser001/Documents/invoice.pdf"--action runFromCsv --file "/Users/appfireuser001/Documents/CLIInstaller/attachments.csv" --common "--action addAttachment"