Pull to refresh

Jira CLI: Interactive Command-line Tool for Atlassian Jira

Open source *Shells *Go *
Sandbox

A similar version of this post first appeared in Medium and dev.to.

JiraCLI is an interactive command line tool for Atlassian Jira that will help you avoid Jira UI to some extent. This tool is not yet considered complete but has all the essential features required to improve your workflow with Jira.

The tool started with the idea of making issue search and navigation as straightforward as possible. However, with the help of outstanding supporters like you, we evolved, and the tool now includes all necessary features like issue creation, cloning, linking, ticket transition, and much more.

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.

The latest release of the tool supports on-premise jira installation.

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 

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.

Tags:
Hubs:
Total votes 3: ↑3 and ↓0 +3
Views 612
Comments Leave a comment