This article is to give the gives step by step instructions on how to install the Jira CLI app and execute CLI commands in Windows with using the CLI client version 9.0 and above.
Instructions
CLI is a command-line interface to access Jira remotely. CLI has 2 two components:
- CLI Client - Installed on any Windows system that has Java wither version 8 or higher.
- CLI Connector - Installed on the server using Universal Plugin Manager (UPM).
JIRA CLI Client Installation:
- You need to download the latest client version from this page. For example, you can click on the atlassian-cli-9.1.0-distribution.zip to download the latest client version v9.1.0. (which is the latest at the time of writing this document).
- Once the file is downloaded, extract the files. For example, you can right-click on the downloaded file and click on Extract FilesAll... as shown in the below screenshot. Here, we have used the 7-Zip software.
- Go to the ACLI folder (Ex: atlassian-cli-9.1.0)
- Rename the acli-server file to acli as shown in the below screenshot.
Update the acli.properties file as per the below instructions:
Credentials with respect to your instance details of the instance where you want to execute the CLI actions. Here we have used automation/automation as credentials.
Code Block language actionscript3 theme Midnight credentials = --user automation --password automation
If you want to execute the CLI action for Jira, then comment comment the myconfluence option and give the Confluence URL detail of your instanceor add the confluence details, if any.
Code Block language actionscript3 theme Midnight myjira = jira -s https://jira.examplegear.com ${credentials} #myconfluence = confluence -s https://confluence.examplegear.com ${credentials}
This defines the default client for actions, choose either Jira / Confluence based on where you want to execute CLI actions.
Code Block language actionscript3 theme Midnight default = ${myjira}
- Save file.
JIRA CLI Connector Installation:
- Log into Jira as an Administratoradministrator and click > Add-ons → Find new apps and search for "Jira Command Line Interface". Upon receiving the results, click Free trial under the JIRA Command Line Interface (CLI).
- Ensure After installation, ensure that the license is updated in the License section.
- The CLI connector will be installed and you can view the app in the Manage apps page.
Executing the CLI Commands:
- CLI commands are executed from the Windows command prompt. Open the command prompt and go to the path where the CLI client is installed.
Here are the some sample CLI commands:
To create a project, use createProject action along with the required parameters. The below CLI command creates a project with a lead assigned:
Code Block acli myjira --action createProject --project "DEVPROJECT" --lead "user1" --continue project 'DEVPROJECT' created with key DEVPROJECT and id 10200
To create an issue, use createIssue action along with the required /and optional parameters. Below CLI command creates an issue , with issue type and summary in a specific project (CLIPROJ DEVPROJECT in the given example):
Code Block acli myjira --action createIssue --project "DEVPROJECT" --type "bug" --summary "this is my new dev page" Issue DEVPROJECT-1 created with id 10104
To add a comment to an issue, use addComment action along with the required /and optional parameters. Below CLI command adds a comment to a particular issue (DEVPROJECT-1 is the issue key in the given example).
Code Block acli myjira --action addComment --issue "DEVPROJECT-1" --comment "my new comment" Comment with id 10100 added to DEVPROJECT-1
Info |
---|
|