Run multiple CLI commands from a single batch or CSV file or text file

This article explains how to run multiple CLI commands from a single batch or CSV file or text file. 

Run multiple CLI commands from a single batch file

  1. Prefix each CLI command with 'cmd /c' as shown in the sample below:

    cmd /c D:\atlassian-cli-8.7.0\jira.bat --action getServerInfo
    cmd /c D:\atlassian-cli-8.7.0\jira.bat --action addComment  --issue "YUS-1"  --comment "my comment"
  2. Run the batch file from CLI.

    D:\atlassian-cli-8.7.0>new.bat

Result

Without the 'cmd /c' prefix, only the first command is run in the batch file omitting all the commands that follow.

Run multiple CLI commands from a CSV file

  1. Save the CSV file with the '--action' commands as displayed in the sample below:

    --action getServerInfo
    --action addComment --issue "SUP-22" --comment "my comment"
    --action updateIssue --issue "SUP-21" --reporter "user10"


  2. Run the CSV file as:

    --action run --file "text.csv"

Result

Run multiple CLI commands from a text file

  1. Save the text file with the '--action' commands as displayed in the sample below:

    --action getServerInfo
    --action assignIssue --issue "TEST-8"  --userId "user10"
    --action cloneIssue --issue "TSST-11" --description "clone description"
  2. Run the text file as:

    --action run --file "text.txt"

Result