Jira CLI
Repository: https://github.com/ankitpokhrel/jira-cli
Jira CLI allows for the use of a personal access token generated from Jira to be used to view, manage and create tickets from the command line. This opens up possible scripting to easily automate ticket status and peer review subtasks. You will need a personal access token as well as a username.
Installation Guide
-
Open a Terminal window:
-
brew install jira-cli -
Open your .zshrc and add:
export JIRA_API_TOKEN="<provided Jira token>"
-
source ~/.zshrc -
jira init
Installation type
> Local
Authentication type
> Bearer
Link to Jira server
> https://issues.mobilehealth.va.gov
Login username
> <USERNAME PROVIDED>
Default project
> CKM
Default board
> Greenfield
-
Should see:
Configuration generated: /Users/<userhome>/.config/.jira/.config.yml -
Confirm that
jira issue view CKM-31229works
Jira Automation Webhook - Create Peer/Acceptance Review
We have Jira automations in place to automatically create and assign peer review tickets to the designated CKM peer reviewer.
To call this webhook, use the following command:
curl -X POST "https://issues.mobilehealth.va.gov/rest/cb-automation/latest/hooks/e2fa15903fa9773b21d929e2829b752bfce2d1a9/?issue/=<TICKET NUMBER OF STORY>"
Example Commands
-
Put a ticket in progress:
jira issue move CKM-31229 "Start Progress"
-
Create a Peer Review subtask:
jira issue create \
--type "Sub-task" \
--project CKM \
--parent <parent CKM ticket> \
--summary "Peer/Acceptance Review" \
--assignee <peer reviewer username> \
--component "<component>>"
? Description <Received>
> Hit enter
? What's next? Submit
> Submit
-
View tickets assigned to me that are open (using JQL):
jira issue list -q "assignee=currentuser() AND status=Open"
-
Assign a ticket:
jira issue assign ISSUE-123 username
-
Comment on a ticket:
jira issue comment add ISSUE-123 "Some comment"
-
Show comments:
jira issue comment list ISSUE-123
-
Attach file:
jira issue attach ISSUE-123 file.txt
-
Watch an issue:
jira issue watch ISSUE-123
-
List projects:
jira project list
-
List boards:
jira board list