This article explains how to add values to five custom fields to multiple issues in bulk using Jira Command Line Interface (CLI).
Instructions
Create a JQL query to find the target issue(s), where the custom field values need to be added. Refer to the following:
Code Block theme Midnight project = ABC AND issuetype = Story
Use runFromIssueList and updateIssue actions to update any number of field values.
Code Block theme Midnight --action runFromIssueList --jql "project = ABC AND issuetype = Story" --common "-a updateIssue --issue @issue@ --field "select1field1=test1" --field "select2field2=test2" --field "select3field3=test3" --field "select4field4=test4" --field "select5field5=test5""
In the above action: select1field1, select2field2, select3field3, select4field4, select5field5 are the text type custom fields and test1, test2, test3, test4, test5 are the corresponding values of the fields.
--jql for the JQL query
--issue takes the issue key
--field accepts the custom field ID or name
To run the action against a CSV file, make sure the CSV file has the following columns as the following:
In the above screenshot, field1, field2, field3, field4, field5 are the custom field names.Run the action using runFromCsv as the following:
Code Block theme Midnight --action runFromCsv --file "/Users/Downloads/Atlassian/atlassian-cli-9.4.0-SNAPSHOT/filename.csv" --common "--action updateIssue"
Info |
---|
It is recommended to test this scenario in a non-production environment or run the action with the --simulate parameter, to verify the behavior before implementing it in production. |