jira-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Jira CLI

Jira CLI

Interact with Atlassian Jira from the command line using jira-cli.
使用jira-cli从命令行与Atlassian Jira进行交互。

When to Use

使用场景

  • User asks to create, view, edit, or search Jira issues/tickets
  • User needs to transition issues through workflow states (To Do → In Progress → Done)
  • User wants to manage sprints, epics, or boards
  • User needs to assign issues, add comments, or log work time
  • User asks about their current tasks or sprint progress
  • 用户要求创建、查看、编辑或搜索Jira问题/工单
  • 用户需要将问题在工作流状态间流转(待办中 → 进行中 → 已完成)
  • 用户想要管理Sprint、Epic或看板
  • 用户需要分配问题、添加评论或记录工作时长
  • 用户询问自己当前的任务或Sprint进展

Prerequisites

前置条件

  1. Install jira-cli:
    brew install ankitpokhrel/jira-cli/jira-cli
    (macOS) or download from releases
  2. Set API token:
    export JIRA_API_TOKEN="your-token"
  3. Initialize:
    jira init
    and follow prompts
  1. 安装jira-cli:
    brew install ankitpokhrel/jira-cli/jira-cli
    (macOS)或从发布页面下载
  2. 设置API token:
    export JIRA_API_TOKEN="your-token"
  3. 初始化:
    jira init
    并按照提示操作

Issue Commands

问题相关命令

List Issues

列出问题

bash
undefined
bash
undefined

List issues in current project

列出当前项目中的问题

jira issue list
jira issue list

List my assigned issues

列出分配给我的问题

jira issue list -a$(jira me)
jira issue list -a$(jira me)

List issues by status

按状态列出问题

jira issue list -s"In Progress"
jira issue list -s"In Progress"

List high priority issues

列出高优先级问题

jira issue list -yHigh
jira issue list -yHigh

List issues with multiple filters

使用多个筛选条件列出问题

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

List issues with raw JQL

使用原生JQL列出问题

jira issue list -q "project = PROJ AND status = 'In Progress'"
jira issue list -q "project = PROJ AND status = 'In Progress'"

Plain text output for scripting

输出纯文本用于脚本

jira issue list --plain --columns key,summary,status --no-headers
undefined
jira issue list --plain --columns key,summary,status --no-headers
undefined

Create Issues

创建问题

bash
undefined
bash
undefined

Interactive issue creation

交互式创建问题

jira issue create
jira issue create

Create with all options specified

指定所有选项创建问题

jira issue create -tBug -s"Login button not working" -b"Description here" -yHigh --no-input
jira issue create -tBug -s"Login button not working" -b"Description here" -yHigh --no-input

Create a story

创建用户故事

jira issue create -tStory -s"Add user authentication" -yMedium
jira issue create -tStory -s"Add user authentication" -yMedium

Create with labels and components

创建带标签和组件的问题

jira issue create -tTask -s"Update dependencies" -lmaintenance -l"tech-debt" -Cbackend
jira issue create -tTask -s"Update dependencies" -lmaintenance -l"tech-debt" -Cbackend

Create and assign to self

创建并分配给自己

jira issue create -tBug -s"Fix crash on startup" -a$(jira me) --no-input
undefined
jira issue create -tBug -s"Fix crash on startup" -a$(jira me) --no-input
undefined

View Issues

查看问题

bash
undefined
bash
undefined

View issue details

查看问题详情

jira issue view ISSUE-123
jira issue view ISSUE-123

View with comments

查看问题及评论

jira issue view ISSUE-123 --comments 10
jira issue view ISSUE-123 --comments 10

View in plain text

以纯文本格式查看

jira issue view ISSUE-123 --plain
jira issue view ISSUE-123 --plain

Open issue in browser

在浏览器中打开问题

jira open ISSUE-123
undefined
jira open ISSUE-123
undefined

Edit Issues

编辑问题

bash
undefined
bash
undefined

Edit summary

编辑摘要

jira issue edit ISSUE-123 -s"Updated summary"
jira issue edit ISSUE-123 -s"Updated summary"

Edit description

编辑描述

jira issue edit ISSUE-123 -b"New description"
jira issue edit ISSUE-123 -b"New description"

Edit priority

编辑优先级

jira issue edit ISSUE-123 -yHigh
jira issue edit ISSUE-123 -yHigh

Add labels

添加标签

jira issue edit ISSUE-123 -lnew-label
undefined
jira issue edit ISSUE-123 -lnew-label
undefined

Transition Issues

流转问题

bash
undefined
bash
undefined

Move issue to a new status

将问题移动到新状态

jira issue move ISSUE-123 "In Progress"
jira issue move ISSUE-123 "In Progress"

Move with comment

带评论流转问题

jira issue move ISSUE-123 "Done" --comment "Completed the task"
jira issue move ISSUE-123 "Done" --comment "Completed the task"

Move and set resolution

流转并设置解决结果

jira issue move ISSUE-123 "Done" -RFixed
undefined
jira issue move ISSUE-123 "Done" -RFixed
undefined

Assign Issues

分配问题

bash
undefined
bash
undefined

Assign to self

分配给自己

jira issue assign ISSUE-123 $(jira me)
jira issue assign ISSUE-123 $(jira me)

Assign to specific user

分配给特定用户

jira issue assign ISSUE-123 username
jira issue assign ISSUE-123 username

Unassign

取消分配

jira issue assign ISSUE-123 x
undefined
jira issue assign ISSUE-123 x
undefined

Comments

评论

bash
undefined
bash
undefined

Add a comment

添加评论

jira issue comment add ISSUE-123 "This is my comment"
jira issue comment add ISSUE-123 "This is my comment"

Add comment from editor

从编辑器添加评论

jira issue comment add ISSUE-123
undefined
jira issue comment add ISSUE-123
undefined

Work Logging

工作时长记录

bash
undefined
bash
undefined

Log time

记录工作时长

jira issue worklog add ISSUE-123 "2h 30m"
jira issue worklog add ISSUE-123 "2h 30m"

Log time with comment

带评论记录工作时长

jira issue worklog add ISSUE-123 "1d 4h" --comment "Completed feature implementation" --no-input
undefined
jira issue worklog add ISSUE-123 "1d 4h" --comment "Completed feature implementation" --no-input
undefined

Link & Clone Issues

关联与克隆问题

bash
undefined
bash
undefined

Link two issues

关联两个问题

jira issue link ISSUE-123 ISSUE-456 Blocks
jira issue link ISSUE-123 ISSUE-456 Blocks

Unlink issues

取消问题关联

jira issue unlink ISSUE-123 ISSUE-456
jira issue unlink ISSUE-123 ISSUE-456

Clone an issue

克隆问题

jira issue clone ISSUE-123 -s"Cloned: New summary"
jira issue clone ISSUE-123 -s"Cloned: New summary"

Delete an issue

删除问题

jira issue delete ISSUE-123
undefined
jira issue delete ISSUE-123
undefined

Epic Commands

Epic相关命令

bash
undefined
bash
undefined

List epics

列出Epic

jira epic list
jira epic list

List epics in table format

以表格格式列出Epic

jira epic list --table
jira epic list --table

Create an epic

创建Epic

jira epic create -n"Q1 Features" -s"Epic summary" -b"Epic description"
jira epic create -n"Q1 Features" -s"Epic summary" -b"Epic description"

Add issues to epic

向Epic添加问题

jira epic add EPIC-1 ISSUE-123 ISSUE-456
jira epic add EPIC-1 ISSUE-123 ISSUE-456

Remove issues from epic

从Epic移除问题

jira epic remove ISSUE-123 ISSUE-456
undefined
jira epic remove ISSUE-123 ISSUE-456
undefined

Sprint Commands

Sprint相关命令

bash
undefined
bash
undefined

List sprints

列出Sprint

jira sprint list
jira sprint list

List current/active sprint

列出当前/活跃Sprint

jira sprint list --current
jira sprint list --current

List my issues in current sprint

列出当前Sprint中分配给我的问题

jira sprint list --current -a$(jira me)
jira sprint list --current -a$(jira me)

Add issues to sprint

向Sprint添加问题

jira sprint add SPRINT_ID ISSUE-123 ISSUE-456
undefined
jira sprint add SPRINT_ID ISSUE-123 ISSUE-456
undefined

Project & Board Commands

项目与看板相关命令

bash
undefined
bash
undefined

List projects

列出项目

jira project list
jira project list

List boards

列出看板

jira board list
jira board list

List releases/versions

列出发布/版本

jira release list
jira release list

Open project in browser

在浏览器中打开项目

jira open
undefined
jira open
undefined

Utility Commands

实用命令

bash
undefined
bash
undefined

Get current username

获取当前用户名

jira me
jira me

Show help

显示帮助

jira --help jira issue --help
jira --help jira issue --help

Setup shell completion

设置Shell自动补全

jira completion bash # or zsh, fish, powershell
undefined
jira completion bash # 或zsh, fish, powershell
undefined

Common Flags

常用标志

FlagDescription
--plain
Plain text output (no interactive UI)
--raw
Raw JSON output
--csv
CSV output
--no-input
Skip interactive prompts
-t, --type
Issue type (Bug, Story, Task, Epic)
-s, --summary
Issue summary/title
-b, --body
Issue description
-y, --priority
Priority (Highest, High, Medium, Low, Lowest)
-l, --label
Labels (repeatable)
-a, --assignee
Assignee username
-r, --reporter
Reporter username
-C, --component
Component name
-P, --parent
Parent issue/epic key
-q, --jql
Raw JQL query
--created
Filter by creation date (-7d, week, month)
--order-by
Sort field
--reverse
Reverse sort order
标志描述
--plain
纯文本输出(无交互式UI)
--raw
原始JSON输出
--csv
CSV格式输出
--no-input
跳过交互式提示
-t, --type
问题类型(Bug, Story, Task, Epic)
-s, --summary
问题摘要/标题
-b, --body
问题描述
-y, --priority
优先级(Highest, High, Medium, Low, Lowest)
-l, --label
标签(可重复使用)
-a, --assignee
经办人用户名
-r, --reporter
报告人用户名
-C, --component
组件名称
-P, --parent
父问题/Epic的键
-q, --jql
原生JQL查询
--created
按创建日期筛选(-7d, week, month)
--order-by
排序字段
--reverse
反转排序顺序

Common Workflows

常见工作流

Start Working on an Issue

开始处理问题

bash
undefined
bash
undefined

Assign to self and move to In Progress

分配给自己并移至“进行中”状态

jira issue assign ISSUE-123 $(jira me) jira issue move ISSUE-123 "In Progress"
undefined
jira issue assign ISSUE-123 $(jira me) jira issue move ISSUE-123 "In Progress"
undefined

Complete an Issue

完成问题

bash
undefined
bash
undefined

Log work and close

记录工作时长并关闭问题

jira issue worklog add ISSUE-123 "4h" --no-input jira issue move ISSUE-123 "Done" --comment "Completed" -RFixed
undefined
jira issue worklog add ISSUE-123 "4h" --no-input jira issue move ISSUE-123 "Done" --comment "Completed" -RFixed
undefined

Daily Standup Review

每日站会回顾

bash
undefined
bash
undefined

View my current sprint tasks

查看当前Sprint中分配给我的任务

jira sprint list --current -a$(jira me)
undefined
jira sprint list --current -a$(jira me)
undefined

Create and Track a Bug

创建并跟踪Bug

bash
undefined
bash
undefined

Create bug

创建Bug

jira issue create -tBug -s"App crashes on login" -yHigh -lbug --no-input
jira issue create -tBug -s"App crashes on login" -yHigh -lbug --no-input

Note the returned issue key, then assign

记录返回的问题键,然后分配给自己

jira issue assign BUG-123 $(jira me) jira issue move BUG-123 "In Progress"
undefined
jira issue assign BUG-123 $(jira me) jira issue move BUG-123 "In Progress"
undefined

Output Examples

输出示例

CommandUse Case
jira issue list --plain
Script-friendly output
jira issue list --raw
JSON for parsing
jira issue list --csv
Export to spreadsheet
命令使用场景
jira issue list --plain
适合脚本的输出格式
jira issue list --raw
用于解析的JSON格式
jira issue list --csv
导出至电子表格

Limitations

限制

  • Requires prior
    jira init
    configuration
  • Some features may vary between Jira Cloud and Server
  • Complex custom fields may require
    --custom
    flag with field IDs
  • Rate limits apply based on Jira instance configuration
  • 需要先完成
    jira init
    配置
  • Jira Cloud与Server之间部分功能可能存在差异
  • 复杂自定义字段可能需要配合
    --custom
    标志和字段ID使用
  • 速率限制取决于Jira实例的配置