关于 jira-cli
面向通过命令行处理 Jira 项目的用户,可管理问题并查看冲刺任务。除问题操作外,还涵盖史诗、冲刺、看板和工时记录。
主要功能
- 01创建、查看、编辑和搜索问题
- 02转换问题状态并分配负责人
- 03添加评论和记录工时
- 04管理史诗、冲刺和看板
- 05导出纯文本、JSON 或 CSV
适用场景
- 01查看当前冲刺中分配给自己的问题
- 02创建缺陷并推进其工作流状态
- 03记录工时并关闭已完成的问题
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ code-and-sorts/ awesome-copilot-agents --skill jira-cli安装后在 Claude Code 中输入/jira-cli确认已加载。
详细介绍
Jira CLI
使用 jira-cli 从命令行与 Atlassian Jira 交互。
适用场景
- 用户要求创建、查看、编辑或搜索 Jira 问题/工单
- 用户需要按照工作流状态推进问题(To Do → In Progress → Done)
- 用户想要管理冲刺、史诗或看板
- 用户需要分配问题、添加评论或记录工时
- 用户询问当前任务或冲刺进度
前提条件
- 安装 jira-cli:
brew install ankitpokhrel/jira-cli/jira-cli(macOS),或从 releases 下载 - 设置 API 令牌:
export JIRA_API_TOKEN="your-token" - 初始化:运行
jira init并按照提示操作
问题命令
列出问题
# List issues in current project
jira issue list
# List my assigned issues
jira issue list -a$(jira me)
# List issues by status
jira issue list -s"In Progress"
# List high priority issues
jira issue list -yHigh
# List issues with multiple filters
jira issue list -a$(jira me) -s"To Do" -yHigh --created week
# List issues with raw JQL
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
创建问题
# Interactive issue creation
jira issue create
# Create with all options specified
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
# Create with labels and components
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
查看问题
# View issue details
jira issue view ISSUE-123
# View with comments
jira issue view ISSUE-123 --comments 10
# View in plain text
jira issue view ISSUE-123 --plain
# Open issue in browser
jira open ISSUE-123
编辑问题
# Edit summary
jira issue edit ISSUE-123 -s"Updated summary"
# Edit description
jira issue edit ISSUE-123 -b"New description"
# Edit priority
jira issue edit ISSUE-123 -yHigh
# Add labels
jira issue edit ISSUE-123 -lnew-label
转换问题状态
# Move issue to a new status
jira issue move ISSUE-123 "In Progress"
# Move with comment
jira issue move ISSUE-123 "Done" --comment "Completed the task"
# Move and set resolution
jira issue move ISSUE-123 "Done" -RFixed
分配问题
# Assign to self
jira issue assign ISSUE-123 $(jira me)
# Assign to specific user
jira issue assign ISSUE-123 username
# Unassign
jira issue assign ISSUE-123 x
评论
# Add a comment
jira issue comment add ISSUE-123 "This is my comment"
# Add comment from editor
jira issue comment add ISSUE-123
记录工时
# Log time
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
关联和克隆问题
# Link two issues
jira issue link ISSUE-123 ISSUE-456 Blocks
# Unlink issues
jira issue unlink ISSUE-123 ISSUE-456
# Clone an issue
jira issue clone ISSUE-123 -s"Cloned: New summary"
# Delete an issue
jira issue delete ISSUE-123
史诗命令
# List epics
jira epic list
# List epics in table format
jira epic list --table
# Create an epic
jira epic create -n"Q1 Features" -s"Epic summary" -b"Epic description"
# Add issues to epic
jira epic add EPIC-1 ISSUE-123 ISSUE-456
# Remove issues from epic
jira epic remove ISSUE-123 ISSUE-456
冲刺命令
# List sprints
jira sprint list
# List current/active sprint
jira sprint list --current
# List my issues in current sprint
jira sprint list --current -a$(jira me)
# Add issues to sprint
jira sprint add SPRINT_ID ISSUE-123 ISSUE-456
项目和看板命令
# List projects
jira project list
# List boards
jira board list
# List releases/versions
jira release list
# Open project in browser
jira open
实用命令
# Get current username
jira me
# Show help
jira --help
jira issue --help
# Setup shell completion
jira completion bash # or zsh, fish, powershell
常用标志
| 标志 | 说明 |
|---|---|
--plain | 纯文本输出(无交互式界面) |
--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 | 父问题/史诗键 |
-q, --jql | 原始 JQL 查询 |
--created | 按创建日期筛选(-7d、week、month) |
--order-by | 排序字段 |
--reverse | 反转排序顺序 |
常见工作流
开始处理问题
# Assign to self and move to In Progress
jira issue assign ISSUE-123 $(jira me)
jira issue move ISSUE-123 "In Progress"
完成问题
# Log work and close
jira issue worklog add ISSUE-123 "4h" --no-input
jira issue move ISSUE-123 "Done" --comment "Completed" -RFixed
每日站会回顾
# View my current sprint tasks
jira sprint list --current -a$(jira me)
创建并跟踪 Bug
# Create bug
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"
输出示例
| 命令 | 使用场景 |
|---|---|
jira issue list --plain | 便于脚本处理的输出 |
jira issue list --raw | 用于解析的 JSON |
jira issue list --csv | 导出到电子表格 |
限制
- 需要事先运行
jira init完成配置 - 某些功能在 Jira Cloud 和 Server 之间可能有所不同
- 复杂的自定义字段可能需要使用带有字段 ID 的
--custom标志 - 速率限制取决于 Jira 实例的配置
评论
支持 Markdown