jira-cli

module
v0.0.0-...-4a32d21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT

README

JiraCLI

Build Software License

Feature-rich Interactive Jira Command Line

A fork of ankitpokhrel/jira-cli with additional features and fixes.

JiraCLI Demo

JiraCLI is an interactive command line tool for Atlassian Jira that will help you avoid using the Jira UI to some extent. This tool may not be able to do everything, but it has all the essential features required to improve your day-to-day workflow with Jira.

The tool started with the idea of making issue search and navigation as straightforward as possible, and has since evolved to include features like issue creation, cloning, linking, ticket transition, and much more.

This tool is heavily inspired by the GitHub CLI

About this fork

This is a fork of ankitpokhrel/jira-cli. It stays close to upstream, but ships bug fixes, dependency updates, and features that have been waiting on upstream for a while. Releases, Homebrew casks, and Docker images are published from this repository (see Installation).

Additional features

Features not available upstream. Each is documented under Commands; #N links to the upstream issue or PR asking for it.

New commands

  • jira issue worklog list|edit|delete and jira worklog list: manage worklogs by id, and list what a user logged on a day across all issues. #908
  • jira issue comment list|edit|delete and comment add --reply-to ID: manage comments by id, and reply with a quote. #975
  • jira issue attachment add|list|download: upload, list, and download attachments. #986
  • jira issue transitions: list the transitions an issue can take, without moving it.
  • jira issue link types: list link type names with their outward and inward wording.
  • jira issue link remote list: list an issue's remote web links with id, title and URL. #873
  • jira issue changelog: print an issue's change history, optionally for one field, or as a unified diff per change with --diff.
  • jira issue fields -t TYPE: list the fields a create screen needs, with the values --custom accepts.
  • jira issue unlink remote: remove a remote web link. #1006
  • jira release create: create a project version. #1002
  • jira sprint remove: move issues back to the backlog.

New flags

  • jira issue edit --type: change the issue type in place.
  • jira issue edit --original-estimate #801, --template, --append-body/--prepend-body (add to the end or start of the description), --replace-body (change text in place), and --adf-body (write raw ADF, Cloud).
  • jira issue transitions --fields: list the fields each transition's screen asks for.
  • jira issue move --path [--yes]: find and take the transitions to a status several steps away.
  • jira issue view --description: print only the summary and description. #933
  • jira issue list --plain --columns: print only the requested columns, without forcing KEY. #747
  • jira sprint list --board: list sprints of another board. #847
  • jira project list --raw: print the API response, including project ids. #885
  • jira init --scoped-token: use scoped API tokens on Jira Cloud. #850
  • --custom takes cascading selects (Parent->Child) #949 and field ids, finds fields added after jira init, and rejects unknown keys.

Behavior

  • @[Name] in issue, epic, and comment bodies becomes a real mention, and editing keeps existing mentions. #407
  • Issue URLs of your own site render as smart links on Jira Cloud.
  • jira issue view shows the parent issue. #766
  • jira issue link prints the link as it reads ("A blocks B"), and its prompt and help say which issue gets which wording.
  • jira issue edit won't replace a description that embeds images unless --allow-image-loss is passed. #1005
  • An HTML response from an SSO redirect, VPN portal, or proxy gives a readable error. #630
  • Releases ship SLSA provenance and an SBOM; every merge to main publishes a snapshot cask and Docker image.

The fork also fixes a number of open upstream bugs; see the commit history.

Supported platforms

[!NOTE] Some features might work slightly differently in Jira Cloud versus on-premises installations due to the nature of the data. Yet, we've attempted to make the experience as similar as possible.

Platform LinuxmacOSFreeBSDNetBSDWindows
Jira Jira CloudJira Server

Installation

jira-cli is available as a downloadable packaged binary for Linux, macOS, and Windows from the releases page.

Install it with Homebrew from the tap:

brew install --cask rethab/jira-cli/jira-cli

Every release carries SLSA build provenance: a signed attestation that the archive was built by this repository's release workflow from the tagged commit. To verify a downloaded archive:

gh attestation verify jira_3.0.0_macOS_arm64.tar.gz --repo rethab/jira-cli

Each archive also ships an SPDX SBOM (*.sbom.json on the release page) listing the full dependency tree, ready for scanners like grype.

Every merge to main also publishes a snapshot build with the same checksums, provenance, and SBOMs as a release:

brew install --cask rethab/jira-cli/jira-cli-snapshot

You can use Docker to quickly try out jira-cli. Images are published to ghcr.io/rethab/jira-cli for linux/amd64, linux/arm64, linux/arm/v6 and linux/arm/v7, each with a signed provenance attestation.

latest follows main, so pin a version tag if you want a stable image:

docker run -it --rm ghcr.io/rethab/jira-cli:latest   # tip of main
docker run -it --rm ghcr.io/rethab/jira-cli:3.0.0    # a release

Getting started

Cloud server
  1. Get a Jira API token and export it to your shell as a JIRA_API_TOKEN variable. Add it to your shell configuration file, for instance, $HOME/.bashrc, so that the variable is always available. Alternatively, you can also use .netrc file or keychain to set the token. Learn more here. In .netrc, use the bare host as the machine (for example, machine your-site.atlassian.net); a full URL such as https://your-site.atlassian.net is also accepted.
  2. Run jira init, select installation type as Cloud, and provide required details to generate a config file required for the tool.
Scoped API tokens

Atlassian also lets you create an API token with scopes, for example a read-only token. Unlike a regular token, a scoped token is rejected by your site URL (https://<site>.atlassian.net) and only works through the Atlassian API gateway, https://api.atlassian.com/ex/jira/<cloudId>.

Pass --scoped-token to jira init and the cloud ID is looked up for you:

jira init --installation cloud --server https://<site>.atlassian.net --login you@example.com --scoped-token

The gateway URL is saved as server, and your site URL as browse_server, so links printed or opened by the tool (e.g. jira open) still point to your site. Regular API tokens should not use this flag.

If you keep the token in ~/.netrc, the entry's machine must be api.atlassian.com, since that is now the server host.

If you already know your cloud ID, you can skip the lookup and pass the gateway URL as the server instead. In that case, also set browse_server in the generated config to your site URL to keep browser links working:

jira init --installation cloud --server https://api.atlassian.com/ex/jira/<cloudId> --login you@example.com

A scoped token only allows what its scopes cover, so select scopes for the features you use, such as read:jira-work, write:jira-work and read:jira-user. Boards and sprints use the Jira Software API, which has its own scopes, such as read:board-scope:jira-software and read:sprint:jira-software. See Atlassian's Jira scopes reference and the scopes listed per endpoint in the Jira Software REST API.

On-premises installation
  1. Export required environment variables:
    • If you are using basic auth, export the password you use to login to Jira as a JIRA_API_TOKEN variable.
    • If you are using personal access token (PAT), get the token from your Jira profile and export it as a JIRA_API_TOKEN variable. In addition to this, set JIRA_AUTH_TYPE env to bearer.
    • Add these ENVs to your shell configuration file, for instance, $HOME/.bashrc, so that they are always available.
    • Alternatively, you can also use .netrc file or keychain to set the token. Learn more here. In .netrc, use the bare host as the machine (for example, machine jira.example.com), even if your server URL has a port; a full URL such as https://jira.example.com:8443 is also accepted.
  2. Run jira init, select installation type as Local, and provide the required details to generate a config file required for the tool.
    • The most common auth type for an on-premises installation is basic. If you are using your Jira login credentials (username and password), select the basic auth type.
    • If you want to use mtls (client certificates), select auth type mtls and provide the CA Cert, client Key, and client cert.

[!IMPORTANT] If your on-premises Jira installation is using a language other than English, then the issue/epic creation may not work because the older version of Jira API doesn't return the untranslated name for issuetypes. In that case, you will have to fill in epic.name, epic.link and issue.types.*.handle fields manually in the generated config to get the expected behavior.

See FAQs for frequently asked questions.

Authentication types

The tool supports basic, bearer (Personal Access Token), mtls (Client Certificates), and cf-access (Cloudflare Access) authentication types. Basic auth is used by default.

  • If you want to use PAT, you need to set JIRA_AUTH_TYPE as bearer.
  • If you want to use mtls run jira init. Select installation type Local, and then select authentication type as mtls.
    • In case JIRA_API_TOKEN variable is set it will be used together with mtls.
  • If your server sits behind Cloudflare Access, run jira init, select installation type Local, and then select authentication type as cf-access. The tool fetches an access token through cloudflared's login flow (opening your browser if needed) and sends it with every request. No JIRA_API_TOKEN is required.
Shell completion

Check jira completion --help for more info on setting up a Bash/Zsh shell completion.

Multiple projects

You can load a specific configuration file by using the --config/-c flag, or by setting the JIRA_CONFIG_FILE environment variable to specify the file's location.

$ JIRA_CONFIG_FILE=./local_jira_config.yaml jira issue list

# Alternatively, use the `--config/-c` flag
$ jira issue list -c ./local_jira_config.yaml

Usage

The tool currently comes with an issue, epic, and sprint explorer. The flags are POSIX-compliant. You can combine available flags in any order to create a unique query. For example, the command below will give you high priority issues created this month with status To Do that are assigned to you and has the label backend.

jira issue list -yHigh -s"To Do" --created month -lbackend -a$(jira me)

Navigation

The lists are displayed in an interactive UI by default.

  • Use arrow keys or j, k, h, l characters to navigate through the list.
  • Use g and G to quickly navigate to the top and bottom respectively.
  • Use CTRL + f to scroll through a page downwards direction.
  • Use CTRL + b to scroll through a page in upwards direction.
  • Press v to view selected issue details.
  • Press m to transition the selected issue.
  • Press CTRL + r or F5 to refresh the issues list.
  • Hit ENTER to open the selected issue in the browser.
  • Press c to copy issue URL to the system clipboard. This requires xclip / xsel on Linux.
  • Press CTRL + k to copy issue key to the system clipboard.
  • In an explorer view, press w or TAB to toggle focus between the sidebar and the contents screen.
  • Press q / ESC / CTRL + c to quit.
  • Press ? to open the help window.

Resources

Commands

Issue

Issues are displayed in an interactive table view by default. You can output the results in a plain view using the --plain flag.

List

The list command lets you search and navigate the issues. The issues are sorted by created field in descending order by default.

# List recent issues
$ jira issue list

# List issues created in last 7 days
$ jira issue list --created -7d

# List issues in status "To Do"
$ jira issue list -s"To Do"

# List recent issues in plain mode
$ jira issue list --plain

# List recent issues in raw JSON format
$ jira issue list --raw

# List recent issues in csv format
$ jira issue list --csv

# List issue in the same order as you see in the UI
$ jira issue list --order-by rank --reverse

# You can execute raw JQL within a given project context using `--jql/-q` option.
# For instance, the following command will list issues in the current project whose
# summary has a word cli.
$ jira issue list -q "summary ~ cli"

Check some more examples/use-cases below.

List issues that I am watching
jira issue list -w
List issues assigned to me
jira issue list -a$(jira me)
List issues assigned to a user and are reported by another user
jira issue list -a"User A" -r"User B"
List issues assigned to me, is of high priority and is open
jira issue list -a$(jira me) -yHigh -sopen
List issues assigned to no one and are created this week
jira issue list -ax --created week
List issues with resolution won't do
jira issue list -R"Won't do"
List issues whose status is not done and is created before 6 months and is assigned to someone
# Tilde (~) acts as a not operator
jira issue list -s~Done --created-before -24w -a~x
List issues created within an hour and updated in the last 30 minutes :stopwatch:
jira issue list --created -1h --updated -30m
Give me issues that are of high priority, are in progress, were created this month, and have given labels :fire:
jira issue list -yHigh -s"In Progress" --created month -lbackend -l"high-prio"
Wait, what was that ticket I opened earlier today? :tired_face:
jira issue list --history
What was the first issue I ever reported on the current board? :thinking:
jira issue list -r$(jira me) --reverse
What was the first bug I ever fixed in the current board? :beetle:
jira issue list -a$(jira me) -tBug -sDone -rFixed --reverse
What issues did I report this week? :man_shrugging:
jira issue list -r$(jira me) --created week
Am I watching any tickets in project XYZ? :monocle_face:
jira issue list -w -pXYZ
Create

The create command lets you create an issue.

# Create an issue using an interactive prompt
$ jira issue create

# Pass required parameters and use --no-input option to skip prompt
$ jira issue create -tBug -s"New Bug" -yHigh -lbug -lurgent -b"Bug description" --fix-version v2.0 --no-input

To attach epic to an issue on creation, you can use -P/--parent field. We call it parent because the semantics of epic has been changed in next-gen project.

# Create an issue of type Story and attach it to epic with key EPIC-42
$  jira issue create -tStory -s"Epic during creation" -PEPIC-42

Create an issue

You can use a --custom flag to set custom fields while creating the issue. See this post for more details.

A field is addressed by its name in lowercase with dashes (Story Points becomes story-points) or by its id (customfield_10016); the id is also the way to tell apart two fields with the same name. Fields that are not in the config, e.g. because they were created after jira init, are looked up on the server. A key that matches no field makes the command fail before anything is asked or sent.

$ jira issue create -tStory -s"With custom fields" --custom story-points=3 --custom customfield_10042="Some value"

# Multi-select fields take a comma separated list
$ jira issue create -tProblem -s"Multi select" --custom environments-affected="Development,Staging"

# Cascading selects take "Parent->Child"; without "->" only the parent is set
$ jira issue create -tProblem -s"Cascading select" --custom platform-component="Pipelines/Scripts->Environment Management"

To find out which fields an issue type needs, and what values they accept, use jira issue fields. It lists the fields of the create screen with their id, type, and whether they are required, followed by the allowed values written the way --custom takes them. It accepts the same -p/--project and -t/--type as create.

$ jira issue fields -t Problem
Platform Component (customfield_14694): option-with-child, required
  Pipelines/Scripts->Environment Management
  Pipelines/Scripts->Release

# Only the required fields
$ jira issue fields -p PROJ -t Problem --required

# Tab separated ID, NAME, TYPE, REQUIRED and VALUE, one row per allowed value
$ jira issue fields -t Problem --plain

The command supports both GitHub-flavored and Jira-flavored Markdown for writing description. You can load pre-defined templates using --template flag.

# Load description from template file
$ jira issue create --template /path/to/template.tmpl

# Get description from standard input
$ jira issue create --template -

# Or, use pipe to read input directly from standard input
$ echo "Description from stdin" | jira issue create -s"Summary" -tTask

Markdown render preview

The preview above shows a Markdown template passed in JiraCLI and how it is rendered in the Jira UI.

On Jira Cloud, a bare URL of an issue on your site (https://<site>.atlassian.net/browse/ABC-1) in the description becomes a smart link that shows the issue's summary and status. This also applies to jira issue edit, jira issue comment add and jira issue comment edit. Other URLs, URLs of issues on a different site, and Markdown links with their own text ([text](url)) stay regular links, and so does everything on Server/Data Center. Punctuation directly after a bare URL is not part of the link; write <url> if it should be.

$ jira issue create -s"Follow-up" -tTask -b"Blocked by https://example.atlassian.net/browse/ABC-1 (see the thread)."
Mentions

Write @[Name] in a description or comment to mention a user. The name can be a display name, an email address or, on Server/Data Center, a username. It is looked up among the users who can see the issue (the project, when creating one) and replaced with a real mention that notifies them. If several users match, or the only match isn't exact (@[Jane Doe] finding just "Jane Doerr"), you are asked to choose, and in non-interactive mode (--no-input, standard input) the command fails and lists them, so give a more exact name or an email. A mention that matches no active user is an error, and nothing is sent. @[...] inside code and Markdown links (@[text](url)) is left alone, and so are existing [~...] mentions. The same works in jira issue edit, jira epic create, jira issue comment add and jira issue comment edit.

$ jira issue create -s"Flaky test" -tBug -b"@[Jane Doe] can you look at this?"

When editing, existing mentions are kept in the editor as [~accountid:...] (Cloud) or [~username] (Server/Data Center), so saving doesn't turn them into plain text. Text that already reads @[...] is shown as @\[...], so saving doesn't turn it into a mention.

Edit

The edit command lets you edit an issue.

$ jira issue edit ISSUE-1

# Edit issue in the configured project
$ jira issue edit ISSUE-1 -s"New Bug" -yHigh -lbug -lurgent -CBackend -b"Bug description"

# Use --no-input option to disable interactive prompt
$ jira issue edit ISSUE-1 -s"New updated summary" --no-input

# Replacing a description that contains inline images or attachments would delete them,
# so the command refuses unless you explicitly accept the loss
$ jira issue edit ISSUE-1 -b"New description" --allow-image-loss

# Set the original estimate in Jira's duration format; the remaining estimate is left to Jira
$ jira issue edit ISSUE-1 --original-estimate "1d 4h" --no-input

# Change the issue type; it keeps its status, so Jira refuses if that status isn't in the new type's workflow.
# Jira's error is shown, and the issue then has to be moved in the Jira web UI
$ jira issue edit ISSUE-1 --type Bug --no-input

# Load the new description from a template file
$ jira issue edit ISSUE-1 --template /path/to/template.tmpl

# Use minus (-) to read the template from standard input
$ cat template.tmpl | jira issue edit ISSUE-1 --template -

# Append to the description without rewriting it; a leading list joins a list the description ends with
$ jira issue edit ISSUE-1 --append-body "- Runbook: https://example.com/runbook" --no-input

# Insert at the start of the description; images and other content below stay as they are
$ jira issue edit ISSUE-1 --prepend-body "**Update:** fixed in v2.0" --no-input

# Replace text in the description; images, smart links and other content stay as they are
# Repeat the flag to make several replacements in one update, and leave the replacement empty to delete text
$ jira issue edit ISSUE-1 --replace-body "deploy on Friday:deploy on Monday" --replace-body "(draft) :" --no-input

# Write the description as an Atlassian document (Jira Cloud only); read it with view --raw, change it, write it back
# This drops the first block and keeps everything else, images and smart links included
$ jira issue view ISSUE-1 --raw | jq '.fields.description | .content |= .[1:]' | jira issue edit ISSUE-1 --adf-body - --no-input

# In the interactive prompt, "OriginalEstimate" can be picked under "What would you like to add?"

# Set custom fields, by name or by id; cascading selects take "Parent->Child"
# See Create for how the fields are matched and `jira issue fields` for the values a field accepts
$ jira issue edit ISSUE-1 --custom story-points=5 --custom platform-component="Pipelines/Scripts->Release"

# Use minus (-) to remove label, component or fixVersion
# For instance, to edit issue to
#   - remove label p2, component FE, fixVersion v1.0
#   - add label p1, component BE, fixVersion v2.0
$ jira issue edit ISSUE-1 --label -p2 --label p1 --component -FE --component BE --fix-version -v1.0 --fix-version v2.0

--append-body converts only the Markdown you pass and adds it after the existing description, which is kept as it is, including images, smart links and mentions, so --allow-image-loss isn't needed. It can't be combined with --body or --template, and mentions work as in --body. Used on its own, it updates only the description, so watchers are notified once. --prepend-body does the same at the start of the description, and a list it ends with joins a list the description starts with. The two flags can be combined in one update.

--replace-body "<search>:<replace>" replaces every occurrence of the search text in the existing description and leaves everything else, including images, smart links and mentions, as it is. It can be repeated (applied in order) and combined with --append-body/--prepend-body, but not with --body or --template. The search is split off at the first colon, so it can't contain one. On Jira Cloud the replacement is plain text and takes the formatting of the text it replaces, and a match must lie within text of one formatting: text that spans bold, a link, a mention or a smart link isn't found. On Jira Server the search and the replacement are wiki markup. If a search text isn't found, nothing is changed, not even the other fields given in the same command.

--adf-body <path|-> replaces the description with an Atlassian Document Format (ADF) document read from a file, or from standard input with -, for the edits the flags above can't express: swapping a block for a paragraph and a list, deleting a block, inserting in the middle, or changing text that spans formatting. The file holds the document itself, that is .fields.description of jira issue view --raw. It is sent as is: nothing is converted from Markdown, mentions aren't resolved, and nodes this CLI doesn't know are kept. Jira validates the document and its error is shown. It works on Jira Cloud only, since Server and Data Center store the description as wiki markup, and can't be combined with --body, --template, --append-body, --prepend-body or --replace-body. If the new document leaves out an inline image or attachment of the current description, the command refuses unless you pass --allow-image-loss. The description is written by its own request after any other fields given in the same command.

Assign

The assign command lets you assign a user to an issue.

# Assign user to an issue using an 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

Assign issue to a user

Move/Transition

The move command lets you transition an issue from one state to another.

# Move an issue using an interactive prompt
$ jira issue move

# Pass required parameters to skip prompt
$ jira issue move ISSUE-1 "In Progress"

Move an issue

If your workflow allows to add comment, resolution or assignee while moving an issue, you can do so as shown below. See this documentation on how to setup your workflow to allow these fields.

# Move an issue and add comment
$ jira issue move ISSUE-1 "In Progress" --comment "Started working on it"

# Set resolution to fixed and assign to self while moving the issue
$ jira issue move ISSUE-1 Done -RFixed -a$(jira me)

To transition the selected issue from the TUI, press m.

The transitions command lists what an issue can be moved to without moving it. Each line is the transition name and the status it leads to, which often differ ("Start work" leads to "In Progress"). On Cloud, transitions that are not available are left out, as move does.

$ jira issue transitions ISSUE-1
Start work -> In Progress
Done -> Done

# Tab separated for scripts
$ jira issue transitions ISSUE-1 --plain

# Raw Jira API response, including transitions that are not available
$ jira issue transitions ISSUE-1 --raw

Transitions that open a screen can ask for fields, and some are required: "Rejected" typically asks for a resolution, so the issue ends up resolved. Use --fields to see which transitions have a screen and what it asks for. Fields are sorted by id, and the allowed values are the ones --resolution and friends take.

$ jira issue transitions ISSUE-1 --fields
Start work -> In Progress
Rejected -> Rejected (screen)
    resolution  Resolution  required  Done, Won't Do, Duplicate
    worklog     Log Work    optional

# Tab separated "transition", "status", "field id", "field name", "required|optional" and "allowed values",
# with one line per field
$ jira issue transitions ISSUE-1 --fields --plain

# The raw response, which now includes the fields
$ jira issue transitions ISSUE-1 --fields --raw
Moving through several statuses

transitions only shows one step. When the status you want is several transitions away, use --path with the status you want to end up in, instead of a transition name. Without --yes the command only prints the path.

$ jira issue move ISSUE-1 "To Do" --path
Path from "In Testing" to "To Do" (learnt from the history of 50 PV2 Bug issues):
  1. In Testing -> Ready to Test   (via "Back to Ready to Test")
  2. Ready to Test -> Code Review
  3. Code Review -> In Progress
  4. In Progress -> To Do
Run again with --yes to apply it.

# Take the steps, one transition at a time
$ jira issue move ISSUE-1 "To Do" --path --yes

Reading the workflow definition needs Jira admin rights, so the path is learnt from data every user can read: the transitions available to the issue right now, and the status changes in the history of the issue and of up to 50 recent issues of the same project and issue type. It is the shortest path found there, and it never goes through a status in the done category unless that is the target, since transitions like "Rejected" are available from everywhere and set a resolution. If a step has no matching transition or asks for required fields, the command stops and tells you which status the issue is in; the steps already taken stay applied. --path cannot be combined with --comment, --assignee or --resolution.

View

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

The command uses less as a pager by default. To set your own pager, see https://github.com/ankitpokhrel/jira-cli/discussions/569.

$ jira issue view ISSUE-1

View an issue

The view screen will display linked issues and the latest comment after the description. Note that the displayed comment may not be the latest one if you for some reason have more than 5k comments in a ticket.

# Show 5 recent comments when viewing the issue
$ jira issue view ISSUE-1 --comments 5

# Print only the summary and description, e.g. to feed into another tool
$ jira issue view ISSUE-1 --description
Changelog

The changelog command (alias history) prints the change history of an issue, one line per changed field, oldest first: when it happened, who did it, the field, and the old and new value. Times are shown in your local time zone.

$ jira issue changelog ISSUE-1
2026-10-01 14:03  Jane Doe    status    To Do -> In Progress
2026-10-02 09:41  Jane Doe    assignee  - -> John Roe

# Only the status changes; the field is matched by name or id, ignoring case
$ jira issue changelog ISSUE-1 --field status

# Tab separated "created", "author", "field", "from" and "to", for scripts
$ jira issue changelog ISSUE-1 --field status --plain

# Show what changed in the description, as a unified diff per change with line breaks kept
$ jira issue changelog ISSUE-1 --field description --diff

--diff prints a block per change, with a header and a unified diff of the old and new value, and can't be combined with --plain.

The link command lets you link two issues.

# Link an issue using an interactive prompt
$ jira issue link

# Pass required parameters to skip prompt. ISSUE-1 blocks ISSUE-2
$ jira issue link ISSUE-1 ISSUE-2 Blocks

The first issue gets the link type's outward wording and the second the inward one, so the example reads "ISSUE-1 blocks ISSUE-2" and "ISSUE-2 is blocked by ISSUE-1".

Types

The types command lists the link types of your Jira instance.

# List link type names with their outward and inward wording
$ jira issue link types

# Tab separated name, outward and inward wording, for scripts
$ jira issue link types --plain
Remote

The remote command lets you add a remote web link to an issue.

# Adds a remote web link using an interactive prompt
$ jira issue link remote

# Pass required parameters to skip prompt
$ jira issue link remote ISSUE-1 https://example.com "Example text"

# List the remote web links of an issue
$ jira issue link remote list ISSUE-1

# Tab separated id, title and URL, for scripts
$ jira issue link remote list ISSUE-1 --plain

The list includes the links Confluence adds when a page mentions the issue. The URL it shows is the one jira issue unlink remote takes.

The unlink command lets you unlink two linked issues.

# Unlink issues using interactive prompt
$ jira issue unlink

# Pass required parameters to skip prompt
$ jira issue unlink ISSUE-1 ISSUE-2
Remote

The remote command lets you remove a remote web link from an issue. The link is identified by its URL, which must match exactly. If the issue has several remote links with that URL, all of them are removed.

# Removes a remote web link using an interactive prompt
$ jira issue unlink remote

# Pass required parameters to skip prompt
$ jira issue unlink remote ISSUE-1 https://example.com
Clone

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"
Delete

The delete command lets you delete an issue.

# Delete an issue using an interactive prompt
$ jira issue delete

# Pass required parameters to skip prompt
$ jira issue delete ISSUE-1

# Delete task along with all of its subtasks
$ jira issue delete ISSUE-1 --cascade
Comment

The comment command provides a list of sub-commands to manage issue comments.

Add

The add command lets you add a comment to an issue. The command supports both GitHub-flavored and Jira-flavored Markdown for writing comment. You can load pre-defined templates using --template flag. It prints the id of the new comment, which edit and delete take.

# Add a comment using an interactive prompt
$ jira issue comment add

# Pass required parameters to skip prompt
$ jira issue comment add ISSUE-1 "My comment body"

# Same as above but as an internal comment
$ jira issue comment add ISSUE-1 "My comment body" --internal

# Load comment from template file
$ jira issue comment add ISSUE-1 --template /path/to/template.tmpl

# Get comment from standard input
$ jira issue comment add ISSUE-1 --template -

# Or, use pipe to read input directly from standard input
$ echo "Comment from stdin" | jira issue comment add ISSUE-1

# Mention a user, see Mentions under Create
$ jira issue comment add ISSUE-1 "@[Jane Doe] can you take a look?"

# Mention and quote the comment with the id 10042
$ jira issue comment add ISSUE-1 "Thanks, fixed" --reply-to 10042

--reply-to posts a new top-level comment that starts with a mention of the author of the original comment and a short quote of it. Mentions inside the quote are shown as plain names, so only the author is notified. It is not a threaded reply: Jira's REST API has no parent comment field. The reply keeps the visibility of the comment it answers, so an internal comment, or one restricted to a group or role, is not answered in public.

[!NOTE] For the comment body, the positional argument always takes precedence over the --template flag if both of them are passed. In the example below, the body will be picked from positional argument instead of the template.

jira issue comment add ISSUE-42 "comment body positional" --template - <<'EOF'
comment body template
EOF
List

The list command shows the comments of an issue, oldest first, including the id you need to edit or delete a comment. On Jira Cloud the raw output has the comment bodies in Atlassian Document Format, on Server and Data Center in wiki markup.

$ jira issue comment list ISSUE-1

# Plain, CSV or raw JSON output
$ jira issue comment list ISSUE-1 --plain
$ jira issue comment list ISSUE-1 --csv
$ jira issue comment list ISSUE-1 --raw

# Plain output without the header row is easy to parse in scripts: the first column is the comment id
$ jira issue comment list ISSUE-1 --plain --no-headers | cut -f1

# The raw output has the full author, eg: to find the id of the latest comment of a user
$ jira issue comment list ISSUE-1 --raw | jq -r 'map(select(.author.displayName == "Jane Doe")) | last | .id'
Edit

The edit command replaces the body of a comment. The body is written in Markdown and read like in add: from the positional argument, from --body, from --template, or from standard input. Without a body, your editor opens with the current body of the comment. Whether a comment is internal, and who it is visible to, is kept as it is. update is an alias of edit.

# Edit the comment in your editor
$ jira issue comment edit ISSUE-1 10042

# Pass the new body to skip the prompt
$ jira issue comment edit ISSUE-1 10042 "Fixed comment body"

# Same with a flag, and without any prompt
$ jira issue comment edit ISSUE-1 10042 --body "Fixed comment body" --no-input

# Keep a "living" comment up to date from a script: add it once, then update it by id
$ id=$(jira issue comment add ISSUE-1 "Plan v1" --no-input | sed -n 's/.*(ID: \([0-9]*\)).*/\1/p')
$ jira issue comment update ISSUE-1 "$id" --body "Plan v2" --no-input

# Load the new body from a template file or from standard input
$ jira issue comment edit ISSUE-1 10042 --template /path/to/template.tmpl
$ echo "Comment from stdin" | jira issue comment edit ISSUE-1 10042
Delete

The delete command deletes a comment after asking for confirmation. Pass --no-input to skip the confirmation.

$ jira issue comment delete ISSUE-1 10042

# Skip the confirmation prompt
$ jira issue comment delete ISSUE-1 10042 --no-input
Attachment

The attachment command provides a list of sub-commands to manage issue attachments. It works on Jira Cloud as well as Jira Server and Data Center.

Add

The add command uploads one or more files to an issue and prints the id and name of each new attachment.

$ jira issue attachment add ISSUE-1 screenshot.png

# Upload several files at once
$ jira issue attachment add ISSUE-1 report.pdf logs/*.txt
List

The list command shows the id, file name, size, author and date of the attachments of an issue.

$ jira issue attachment list ISSUE-1

# Plain, CSV or raw JSON output
$ jira issue attachment list ISSUE-1 --plain
$ jira issue attachment list ISSUE-1 --csv
$ jira issue attachment list ISSUE-1 --raw
Download

The download command downloads the attachments of an issue. Without file names or ids it downloads all of them. It never overwrites an existing file silently: if a target file exists, the command fails before downloading anything, unless --overwrite is passed. If an issue has several attachments with the same name, the attachment id is added to the file names.

# Download all attachments to the current directory
$ jira issue attachment download ISSUE-1

# Download specific attachments by file name or id
$ jira issue attachment download ISSUE-1 report.pdf 10042

# Download to a different directory, which is created if needed
$ jira issue attachment download ISSUE-1 -o /path/to/dir

# Replace files that already exist
$ jira issue attachment download ISSUE-1 --overwrite
Worklog

The worklog command provides a list of sub-commands to manage issue worklog (timelog).

Add

The add command lets you add a worklog to an issue. The command supports Markdown for worklog comments.

# Add a worklog using an interactive prompt
$ jira issue worklog add

# Pass required parameters and use --no-input to skip prompt
$ jira issue worklog add ISSUE-1 "2d 3h 30m" --no-input

# You can add a comment using --comment flag when adding a worklog
$ jira issue worklog add ISSUE-1 "10m" --comment "This is a comment" --no-input

The command prints the id of the new worklog.

List

The list command shows an issue's worklogs, newest first, along with their ids. Unlike the worklog field embedded in the issue itself, this uses the dedicated worklog endpoint, so it also works for issues with more than 20 worklogs. Use the id to edit or delete a worklog.

$ jira issue worklog list ISSUE-1

# Show at most 10 entries
$ jira issue worklog list ISSUE-1 --limit 10

# Page through the oldest entries instead
$ jira issue worklog list ISSUE-1 --oldest-first --start 40 --limit 20

# Plain, CSV or raw JSON output
$ jira issue worklog list ISSUE-1 --plain
$ jira issue worklog list ISSUE-1 --plain --no-headers
$ jira issue worklog list ISSUE-1 --csv
$ jira issue worklog list ISSUE-1 --raw
Edit

The edit command changes the time spent, start date or comment of a worklog. Whatever you don't change, including who can see the worklog, is left as it is. Without --no-input it prompts for the time spent and opens your editor on the current comment. The comment supports Markdown. Use --new-estimate to set the remaining estimate of the issue instead of letting Jira adjust it.

# Prompt for the time spent and edit the comment in your editor
$ jira issue worklog edit ISSUE-1 10042

# Pass the new time spent to skip its prompt
$ jira issue worklog edit ISSUE-1 10042 "2d 1h 30m"

# Change only the comment, without any prompt for scripts
$ jira issue worklog edit ISSUE-1 10042 --comment "Fixed comment" --no-input

# Change the start date
$ jira issue worklog edit ISSUE-1 10042 --started "2022-01-01 09:30:00" --timezone "Europe/Berlin" --no-input
Delete

The delete command deletes a worklog after asking for confirmation. Pass --no-input to skip the confirmation, and --new-estimate to set the remaining estimate of the issue instead of letting Jira adjust it.

$ jira issue worklog delete ISSUE-1 10042

# Skip the confirmation prompt
$ jira issue worklog delete ISSUE-1 10042 --no-input

Worklog

The worklog command shows worklogs logged across issues, independent of any single issue.

List

The list command shows what a user logged on a given day, across every issue, along with the worklog ids. Jira has no single endpoint for this, so it searches for candidate issues via JQL, then fetches and filters each issue's worklogs. Use the issue key and the id to edit or delete a worklog with jira issue worklog edit or delete.

# Today's worklogs for the configured user
$ jira worklog list

# A specific day
$ jira worklog list --date 2022-01-02

# A different user's worklogs
$ jira worklog list --user jdoe@example.com

Epic

Epics are displayed in an explorer view by default. You can output the results in a table view using the --table flag. When viewing epic issues, you can use all filters available for the issue command.

See usage to learn more about UI interaction.

List

You can use all flags supported by issue list command here except for the issue type.

# List epics
$ jira epic list

# List epics in a table view
$ jira epic list --table

# List epics reported by me and are open
$ jira epic list -r$(jira me) -sOpen

# List issues in an epic
$ jira epic list KEY-1

# List all issue in an epic KEY-1 that is unassigned and has a high priority
$ jira epic list KEY-1 -ax -yHigh

# List high priority epics
$ jira epic list KEY-1 -yHigh

# List epic issues ordered by rank in ascending order
$ jira epic list KEY-1 --order-by rank --reverse
Create

Creating an epic is the same as creating the issue except you also need to provide an epic name.

# Create an issue using an interactive prompt
$ jira epic create

# Pass required parameters to skip prompt or use --no-input flag to skip prompt for non-mandatory params
$ jira epic create -n"Epic epic" -s"Everything" -yHigh -lbug -lurgent -b"Epic description"
Add

The add command allows you to add issues to the epic. You can add up to 50 issues to the epic at once.

# Add issues to the epic using an interactive prompt
$ jira epic add

# Pass required parameters to skip prompt
$ jira epic add EPIC-KEY ISSUE-1 ISSUE-2
Remove

The remove command allows you to remove issues from the epic. You can remove up to 50 issues from the epic at once.

# Remove issues to the epic using an interactive prompt
$ jira epic remove

# Pass required parameters to skip prompt
$ jira epic remove ISSUE-1 ISSUE-2

Sprint

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. The tool only shows 25 recent sprints.

See usage to learn more about UI interaction.

List

You can use all flags supported by issue list command to filter issues in the sprint.

# List sprints in an explorer view
$ jira sprint list

# List sprints in a table view
$ jira sprint list --table

# List sprints from a board other than the one configured with `jira init`.
# Sprint issues are still filtered by the current project, so pass --project as
# well when the board belongs to another project.
$ jira sprint list --board 42
$ jira sprint list --project OTHER --board 42

# List issues in the current active sprint
$ jira sprint list --current

# List issues in the current active sprint that are assigned to me
$ jira sprint list --current -a$(jira me)

# List issues in the previous sprint
$ jira sprint list --prev

# List issues in next planned sprint
$ jira sprint list --next

# List future and active sprints
$ jira sprint list --state future,active

# List issues in a particular sprint. You can use all flags supported by issue list command here.
# To get sprint id use `jira sprint list` or `jira sprint list --table`
$ jira sprint list SPRINT_ID

# List high priority issues in a sprint are assigned to me
$ jira sprint list SPRINT_ID -yHigh -a$(jira me)

# List sprint issues ordered by rank in ascending order
$ jira sprint list SPRINT_ID --order-by rank --reverse
Add

The add command allows you to add issues to the sprint. You can add up to 50 issues to the sprint at once.

# Add issues to the sprint using interactive prompt
$ jira sprint add

# Pass required parameters to skip prompt
$ jira sprint add SPRINT_ID ISSUE-1 ISSUE-2
Remove

The remove command allows you to move issues to the backlog, i.e. remove them from all active and future sprints. There is no sprint argument, as Jira's backlog endpoint is not sprint-specific. You can remove up to 50 issues at once.

# Remove issues from their sprints using interactive prompt
$ jira sprint remove

# Pass required parameters to skip prompt
$ jira sprint remove ISSUE-1 ISSUE-2

Releases

Interact with releases (project versions).
Ensure the feature is enabled on your instance.

List
# List releases for default project
$ jira release list

# List releases for specific project
$ jira release list --project 1000
$ jira release list --project KEY
Create
# Create a release in the default project
$ jira release create --name "v1.0"

# Create a release with a description and dates (YYYY-MM-DD)
$ jira release create --name "v2.0" --description "Major release" --start-date 2024-11-01 --release-date 2024-12-31

# Create a release in a specific project, already marked as released
$ jira release create --project KEY --name "v1.5" --released

Other commands

Navigate to the project
jira open
Navigate to the issue
jira open KEY-1
List all projects you have access to
jira project list

The --raw option prints the Jira API response as-is, which includes fields that are not part of the rendered table, like the project id.

jira project list --raw
List all boards in a project
jira board list

Scripts

Often times, you may want to use the output of the command to do something cool. However, the default interactive UI might not allow you to do that. The tool comes with the --plain flag that displays results in a simple layout that can then be manipulated from the shell script.

Some example scripts are listed below.

Tickets created per day this month
#!/usr/bin/env bash

tickets=$(jira issue list --created month --plain --columns created --no-headers | awk '{print $2}' | awk -F'-' '{print $3}' | sort -n | uniq -c)

echo "${tickets}" | while IFS=$'\t' read -r line; do
  day=$(echo "${line}" | awk '{print $2}')
  count=$(echo "${line}" | awk '{print $1}')

  printf "Day #%s: %s\n" "${day}" "${count}"
done

# Output
Day #01: 19
Day #02: 10
Day #03: 21
...
Number of tickets per sprint
#!/usr/bin/env bash

sprints=$(jira sprint list --table --plain --columns id,name --no-headers)

echo "${sprints}" | while IFS=$'\t' read -r id name; do
  count=$(jira sprint list "${id}" --plain --no-headers 2>/dev/null | wc -l)

  printf "%10s: %3d\n" "${name}" $((count))
done

# Output
Sprint 3:   55
Sprint 2:   40
Sprint 1:   30
...
Number of unique assignee per sprint
#!/usr/bin/env bash

sprints=$(jira sprint list --table --plain --columns id,name --no-headers)

echo "${sprints}" | while IFS=$'\t' read -r id name; do
  count=$(jira sprint list "${id}" --plain --columns assignee --no-headers 2>/dev/null | awk '{print $2}' | awk NF | sort -n | uniq | wc -l)

  printf "%10s: %3d\n" "${name}" $((count))
done

# Output
Sprint 3:   5
Sprint 2:   4
Sprint 1:   3

Known Issues

  1. Not all Atlassian nodes are translated properly at the moment which can cause formatting issues sometimes.

Feature requests and bugs

Please open an issue in this repository.

Development

  1. Clone the repo.

    git clone git@github.com:rethab/jira-cli.git
    
  2. Optional: If you want to run a Jira instance locally, you can use the following make recipe. The trial license key can be generated from the "Licenses" section in the Atlassian admin.

    make jira.server
    
  3. Make changes, build the binary, and test your changes.

    make install
    
  4. Run CI steps locally before submitting a PR.

    make ci
    

Directories

Path Synopsis
cmd
jira command
internal
cmd/version
Package version prints the version information of the tool.
Package version prints the version information of the tool.
cmdcommon
Package cmdcommon contains methods common to multiple commands.
Package cmdcommon contains methods common to multiple commands.
mention
Package mention turns @[Name] references in a Markdown body into Jira user mentions.
Package mention turns @[Name] references in a Markdown body into Jira user mentions.
pkg
adf
Package adf translates Atlassian Document Format (ADF) to other formats like markdown.
Package adf translates Atlassian Document Format (ADF) to other formats like markdown.
jira
Package jira interacts with the Jira server.
Package jira interacts with the Jira server.
jira/filter
Package filter provides a way to pass optional parameters to client methods.
Package filter provides a way to pass optional parameters to client methods.
jql
Package jql is a very simple JQL query builder that cannot do a lot at the moment.
Package jql is a very simple JQL query builder that cannot do a lot at the moment.
md
Package md translates Jira flavored markdown to CommonMark markdown and viceversa.
Package md translates Jira flavored markdown to CommonMark markdown and viceversa.
netrc
Package netrc implements GNU .netrc specification.
Package netrc implements GNU .netrc specification.
tui
Package tui wraps tview and tcell to create different layouts.
Package tui wraps tview and tcell to create different layouts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL