This document explains the usage of Jira CLI for a use case: How to create sub-task(s) / issues using runFromCsv action or update the status of the issues using the transitionIssue action.
Status is a workflow concept (not the regular JIRA field). It must be updated by workflow progression.
Instructions:
To create the issue(s) using the CLI action:
The following action will create issue of type sub-task(s) only.
./jira.sh --action runFromCsv --file "samplefile.csv" --common "--action createIssue --continue"
For this, the CSV file should contain the fields: project, summary, type and parent.
CLI result: When you run the above CLI createIssue action the result will be shown as below.
Run: --project "WUC" --summary "new by run from csv" --type "Sub-task" --parent "WUC-805" --action createIssue --continue Issue WUC-826 created with id 19408 as subtask of WUC-805. Run: --project "WUC" --summary "new1" --type "Sub-task" --parent "WUC-811" --action createIssue --continue Issue WUC-827 created with id 19409 as subtask of WUC-811. Run completed successfully. 2 actions were successful from file: samplefile.csv
To update the status of the issue(s), run the CLI action:
When u have a list of issue and you want to change the status of the issue, then run the following CLI action.
./jira.sh --action runFromCsv --file "samplefiletoupdate.csv" --common "--action transitionIssue --continue"
For this, the CSV file should contain the fields: issue and transition. The value(s) under issue should be the issue key(s) you want to update the status and the values under transition is to what status you want to transit the issue.
CLI result: When you run the above CLI transitionIssue action the result will be shown as below.
Run: --issue "WUC-802" --transition "Reopen" --action transitionIssue --continue Successfully transitioned issue WUC-802 with transition 'Reopen'. Run: --issue "WUC-803" --transition "Done" --action transitionIssue --continue Successfully transitioned issue WUC-803 with transition 'Done'.
- Before implementing it in the production environment, make sure the above CLI action is tested in your non-production environment.
- Ensure that the parameters server, user and password are mentioned in the jira.sh / jira.bat file.
- Both CLI actions can be executed independently.