12

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

 2 years ago
source link: https://dev.to/konsole/jira-cli-the-missing-command-line-tool-for-atlassian-jira-2n2i
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for Jira CLI: The Missing Command-line Tool for Atlassian Jira
Ankit Pokhrel

Posted on Oct 16

• Originally published at Medium

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

The original version of this post first appeared in Medium.

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!

Since I spend a significant amount of my time in the command-line, this is my small attempt to make Jira experience better for the CLI users.

Introducing Jira CLI

GitHub logo ankitpokhrel / jira-cli

🔥 [WIP] Feature-rich interactive Jira command line.

JiraCLI

Feature-rich Interactive Jira Command Line

🚧 This project is still a work in progress 🚧

JiraCLI is a command line tool for Jira created with an idea to avoid the Jira UI as much as possible. The tool is not yet complete but has all necessary features required to improve your workflow with Jira. The tool mostly focuses on issue search and navigation at the moment However, it also includes features like issue creation, cloning, linking, ticket transition, and so on.

Your suggestions and feedbacks are 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 cool and helpful, consider contributing by starring the repo, sharing with your friends or submitting a PR.

Supported platforms

The tool is only tested with the latest Jira cloud since that's what I…

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 mosty tested with the latest Jira cloud since that’s what I usually work with. However, the support for on-premise Jira installation is on the way.

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
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode

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"
Enter fullscreen modeExit fullscreen mode

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>
Enter fullscreen modeExit fullscreen mode

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK