Introducing Jira CLI: The Missing Command-line Tool for Atlassian Jira

Feature-rich interactive command-line for Jira to boost your productivity.

Ankit Pokhrel🇳🇵
7 min readSep 5, 2021
Photo by Blake Connally on Unsplash

The year is 2078 and there have been 0 improvements in the Jira UI — #rant

Jira UI is terrible to work with. It is slow, buggy, and doesn’t even load on occasions. If you have to rely on it for your day-to-day job it is going to cost you a lot of time and frustration. These frustrations pile up if you need to create tickets, in a pre-defined format with proper labels, components, etc, for every change you make, even a typo!

Motivation

Since I spend a significant amount of my time in the CLI, I started looking for a command-line tool for Jira that would integrate properly with my workflow and keep me away from the chaos of the UI as much as possible.

As a developer, I was looking for a tool with all or most of the following qualities:

  • Allow me to iterate through tickets in an interactive mode.
  • Easily search for tickets. This has to be a satisfying process.
  • List and filter tickets in the current, next, and future sprints. (How do you even list tickets from old sprints in the UI? 🤷‍♂️)
  • Beautifully display the contents of the ticket. I spent most of the time viewing tickets with long and mixed contents.
  • Create tickets using pre-defined templates. There is a strict requirement for creating tickets in our team.
  • Should support common operations like assigning, transitioning, linking, and cloning a ticket.
  • Cloning a ticket should allow me to search and replace strings in the summary and description of the ticket.
  • And more importantly, I should enjoy using the tool every day.

As a manager, I was also interested in a few low-level stats to keep my team and Jira board healthy. Some of these includes:

  • Tickets that are older than 6 months and haven’t been prioritized yet.
  • Cleanups: epics without tickets, old and irrelevant tickets, etc.
  • Metrics like number of tickets per sprint, number of unique assignees per sprint, etc.

After trying out few options, I realized that none of the available tools provides the functionalities I am looking for. So here is my little attempt to solve this particular problem.

Introducing Jira CLI

TLDR; Features Highlight

  • Interactive mode + an option to easily integrate with shell/automation scripts using standard POSIX-complaint flags.
  • Easy search and navigation. For instance, you can easily search for something like “Issues that are of high priority, is in progress, was created this month, and has a label called backend” with jira issue list -yHigh -s"In Progress" --created month -lbackend
  • Create a neat Jira ticket (and comment) using Github-flavored + Jira-flavored markdown as a template. Supports pre-defined templates.
  • The ticket details are translated to markdown from the Atlassian document and is beautifully displayed on the screen when you view it.
  • Easy sprint and epic navigation. You can quickly view tickets in previous, current, and next sprint tickets using flags like --prev, --next, and --current eg: jira sprint list --current.
  • Fast and straightforward ticket cloning with the ability to replace text in summary and description.
  • You can edit, link, assign and transition the issues with ease.
  • Supports multiple Jira servers using --config flag or XDG_CONFIG_HOME env.

Disclaimer

The tool is only tested with the latest Jira cloud at the moment since that’s what I usually work with. There is a plan to support local Jira instances in the future, however, it might not happen anytime soon.

Edit: The tool supports on-premise Jira installation as of v0.1.0.

Also, the tool is still a work in progress with some exciting features in the todo pipeline.

Searching for an Issue

JiraCLI makes searching for an issue as easy as it should be. The lists are displayed in an interactive UI and can be navigated easily to perform actions like viewing, navigating, and copying issue keys/links.

The examples below shows how easy it is to look for an issue. See more examples here.

# List issues that I am watching in the current board
$ jira issue list -w
# List issues assigned to me
$ jira issue list -a$(jira me)
# List issues created within an hour and updated in the last 30 minutes️
$ jira issue list --created -1h --updated -30m
# Give me issues that are of high priority, is in progress, was created this month, and has given labels 🔥
$ jira issue list -yHigh -s"In Progress" --created month -lbackend -l"high prio"
# Wait, what was that ticket I opened earlier today? 😫
$ jira issue list --history
# What was the first issue I ever reported on the current board? 🤔
$ jira issue list -r$(jira me) --reverse
# What was the first bug I ever fixed in the current board? 🐞
$ jira issue list -a$(jira me) -tBug sDone -rFixed --reverse
# What issues did I report this week? 🤷‍♂️
$ jira issue list -r$(jira me) --created week

Creating an Issue

The create command lets you create an issue and supports Github-flavored and Jira-flavored markdown for writing descriptions. You can load pre-defined templates using --template flag.

# Create an issue using interactive prompt
$ jira issue create

# Pass required parameters to skip prompt or use --no-input option
$ jira issue create -tBug -s"New Bug" -yHigh -lbug -lurgent -b"Bug description"
# Load description from template file
$ jira issue create --template /path/to/template.tmpl

The preview below shows the markdown template passed in JiraCLI and the way it is rendered in the Jira UI.

Viewing an Issue

The view command lets you see issue details in a terminal. Atlassian document is roughly converted to a markdown and is nicely displayed in the terminal.

$ jira issue view ISSUE-1

Assigning a user to an issue

The assign command lets you easily assign and unassign users to and from the issue.

# Assign user to an issue using interactive prompt
$ jira issue assign

# Pass required parameters to skip prompt
$ jira issue assign ISSUE-1 "Jon Doe"

# Assign to self
$ jira issue assign ISSUE-1 $(jira me)

# Will prompt for selection if keyword suffix returns multiple entries
$ jira issue assign ISSUE-1 suffix

# Assign to default assignee
$ jira issue assign ISSUE-1 default

# Unassign
$ jira issue assign ISSUE-1 x

Cloning an Issue

The clone command lets you clone an issue. You can update fields like summary, priority, assignee, labels, and components when cloning the issue. The command also allows you to replace a part of the string (case-sensitive) in summary and description using --replace/-H option.

# Clone an issue
$ jira issue clone ISSUE-1

# Clone issue and modify the summary, priority and assignee
$ jira issue clone ISSUE-1 -s"Modified summary" -yHigh -a$(jira me)

# Clone issue and replace text from summary and description
$ jira issue clone ISSUE-1 -H"find-me:replace-with-me"

Sprints

Sprints are displayed in an explorer view by default. You can output the results in a table view using the --table flag. When viewing sprint issues, you can use all filters available for the issue command. You can quickly view tickets in previous, current, and next sprint tickets using flags like --prev, --next, and --current .

# Display sprints in an interactive list
$ jira sprint list
# Display tickets in the current active sprint
$ jira sprint list --current
# Display tickets in the previous sprint
$ jira sprint list --prev
# Display tickets of a particular sprint
$ jira sprint list <SPRINT_ID>

Learn more

Check out the project page to view the full set of features and learn more about the project.

Your suggestions and feedback is highly appreciated. Feel free to start a discussion or create an issue to share your experience about the tool or to discuss a feature/issue. If you think this project is useful, consider contributing by starring the repo, sharing with your friends, or submitting a PR.

--

--