Skip to content

Instantly share code, notes, and snippets.

@emmanuelnk
Last active September 13, 2022 16:10
Show Gist options
  • Save emmanuelnk/4a72412ee5fe0a124313354c2a44c687 to your computer and use it in GitHub Desktop.
Save emmanuelnk/4a72412ee5fe0a124313354c2a44c687 to your computer and use it in GitHub Desktop.
Aliases for jira-cli with Jira Cloud and ZSH
export JIRA_API_TOKEN=XXXXXXXXXXXXXXXXXXX
#------------------
# jira-cli
#------------------
alias jic='jira issue create'
# Pass in a user to see their issues. Defaults to current user
function jil () {
jira issue list -q"status not in (Done, Rejected)" -a${1:-$(jira me)}
}
# Assign the ticket number passed in as an argument to me
# e.g. `jiam RUN-12`
function jiam () {
jira issue assign $1 $(jira me)
}
# Open interactive interface to assign the passed in ticket number
# e.g. `jia TKT-12` will open a prompt for you to search for users
function jia () {
jira issue assign $1
}
# Open interactive interface to move the passed in ticket's status
# e.g. jim TKT-12
function jim () {
jira issue move $1
}
  1. Download latest jira-cli
  2. Install with brew (see repo for other install options)
    brew tap ankitpokhrel/jira-cli
    brew install jira-cli
  3. Get your JIRA API token from JIRA cloud
  4. Export the token to your environment
  5. Run jira init to setup
  6. Use defined aliases to simplify commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment