Jira
Natural language interaction with Jira. Supports multiple backends.
Backend Detection
Run this check first to determine which backend to use:
CODEBLOCK0
| Backend | When to Use | Reference |
|---|
| CLI | INLINECODE0 command available | INLINECODE1 |
| MCP |
Atlassian MCP tools available |
references/mcp.md |
|
None | Neither available | Guide to install CLI |
Quick Reference (CLI)
Skip this section if using MCP backend.
| Intent | Command |
|---|
| View issue | INLINECODE3 |
| List my issues |
jira issue list -a$(jira me) |
| My in-progress |
jira issue list -a$(jira me) -s"In Progress" |
| Create issue |
jira issue create -tType -s"Summary" -b"Description" |
| Move/transition |
jira issue move ISSUE-KEY "State" |
| Assign to me |
jira issue assign ISSUE-KEY $(jira me) |
| Unassign |
jira issue assign ISSUE-KEY x |
| Add comment |
jira issue comment add ISSUE-KEY -b"Comment text" |
| Open in browser |
jira open ISSUE-KEY |
| Current sprint |
jira sprint list --state active |
| Who am I |
jira me |
Quick Reference (MCP)
Skip this section if using CLI backend.
| Intent | MCP Tool |
|---|
| Search issues | INLINECODE14 |
| View issue |
mcp__atlassian__getJiraIssue |
| Create issue |
mcp__atlassian__createJiraIssue |
| Update issue |
mcp__atlassian__editJiraIssue |
| Get transitions |
mcp__atlassian__getTransitionsForJiraIssue |
| Transition |
mcp__atlassian__transitionJiraIssue |
| Add comment |
mcp__atlassian__addCommentToJiraIssue |
| User lookup |
mcp__atlassian__lookupJiraAccountId |
| List projects |
mcp__atlassian__getVisibleJiraProjects |
See references/mcp.md for full MCP patterns.
Triggers
- - "create a jira ticket"
- "show me PROJ-123"
- "list my tickets"
- "move ticket to done"
- "what's in the current sprint"
Issue Key Detection
Issue keys follow the pattern: [A-Z]+-[0-9]+ (e.g., PROJ-123, ABC-1).
When a user mentions an issue key in conversation:
- - CLI:
jira issue view KEY or INLINECODE26 - MCP:
mcp__atlassian__jira_get_issue with the key
Workflow
Creating tickets:
- 1. Research context if user references code/tickets/PRs
- Draft ticket content
- Review with user
- Create using appropriate backend
Updating tickets:
- 1. Fetch issue details first
- Check status (careful with in-progress tickets)
- Show current vs proposed changes
- Get approval before updating
- Add comment explaining changes
Before Any Operation
Ask yourself:
- 1. What's the current state? — Always fetch the issue first. Don't assume status, assignee, or fields are what user thinks they are.
- 2. Who else is affected? — Check watchers, linked issues, parent epics. A "simple edit" might notify 10 people.
- 3. Is this reversible? — Transitions may have one-way gates. Some workflows require intermediate states. Description edits have no undo.
- 4. Do I have the right identifiers? — Issue keys, transition IDs, account IDs. Display names don't work for assignment (MCP).
NEVER
- - NEVER transition without fetching current status — Workflows may require intermediate states. "To Do" → "Done" might fail silently if "In Progress" is required first.
- - NEVER assign using display name (MCP) — Only account IDs work. Always call
lookupJiraAccountId first, or assignment silently fails.
- - NEVER edit description without showing original — Jira has no undo. User must see what they're replacing.
- - NEVER use
--no-input without all required fields (CLI) — Fails silently with cryptic errors. Check project's required fields first.
- - NEVER assume transition names are universal — "Done", "Closed", "Complete" vary by project. Always get available transitions first.
- - NEVER bulk-modify without explicit approval — Each ticket change notifies watchers. 10 edits = 10 notification storms.
Safety
- - Always show the command/tool call before running it
- Always get approval before modifying tickets
- Preserve original information when editing
- Verify updates after applying
- Always surface authentication issues clearly so the user can resolve them
No Backend Available
If neither CLI nor MCP is available, guide the user:
CODEBLOCK1
Deep Dive
LOAD reference when:
- - Creating issues with complex fields or multi-line content
- Building JQL queries beyond simple filters
- Troubleshooting errors or authentication issues
- Working with transitions, linking, or sprints
Do NOT load reference for:
- - Simple view/list operations (Quick Reference above is sufficient)
- Basic status checks (
jira issue view KEY) - Opening issues in browser
| Task | Load Reference? |
|---|
| View single issue | No |
| List my tickets |
No |
| Create with description |
Yes — CLI needs
/tmp pattern |
| Transition issue |
Yes — need transition ID workflow |
| JQL search |
Yes — for complex queries |
| Link issues |
Yes — MCP limitation, need script |
References:
- - CLI patterns: INLINECODE32
- MCP patterns: INLINECODE33
Jira
与Jira的自然语言交互。支持多种后端。
后端检测
首先运行此检查以确定使用哪个后端:
- 1. 检查jira CLI是否可用:
→ 运行:which jira
→ 如果找到:使用CLI后端
- 2. 如果没有CLI,检查Atlassian MCP:
→ 查找mcp
atlassian*工具
→ 如果可用:使用MCP后端
- 3. 如果两者都不可用:
→ 引导用户进行设置
| 后端 | 使用时机 | 参考文档 |
|---|
| CLI | jira 命令可用 | references/commands.md |
| MCP |
Atlassian MCP工具可用 | references/mcp.md |
|
无 | 两者均不可用 | 引导安装CLI |
快速参考(CLI)
如果使用MCP后端,请跳过此部分。
| 意图 | 命令 |
|---|
| 查看问题 | jira issue view ISSUE-KEY |
| 列出我的问题 |
jira issue list -a$(jira me) |
| 我的进行中问题 | jira issue list -a$(jira me) -sIn Progress |
| 创建问题 | jira issue create -tType -s摘要 -b描述 |
| 移动/转换状态 | jira issue move ISSUE-KEY 状态 |
| 分配给我 | jira issue assign ISSUE-KEY $(jira me) |
| 取消分配 | jira issue assign ISSUE-KEY x |
| 添加评论 | jira issue comment add ISSUE-KEY -b评论内容 |
| 在浏览器中打开 | jira open ISSUE-KEY |
| 当前冲刺 | jira sprint list --state active |
| 我是谁 | jira me |
快速参考(MCP)
如果使用CLI后端,请跳过此部分。
| 意图 | MCP工具 |
|---|
| 搜索问题 | mcpatlassiansearchJiraIssuesUsingJql |
| 查看问题 |
mcp
atlassiangetJiraIssue |
| 创建问题 | mcp
atlassiancreateJiraIssue |
| 更新问题 | mcp
atlassianeditJiraIssue |
| 获取转换 | mcp
atlassiangetTransitionsForJiraIssue |
| 转换状态 | mcp
atlassiantransitionJiraIssue |
| 添加评论 | mcp
atlassianaddCommentToJiraIssue |
| 用户查找 | mcp
atlassianlookupJiraAccountId |
| 列出项目 | mcp
atlassiangetVisibleJiraProjects |
完整MCP模式请参见 references/mcp.md。
触发词
- - 创建一个jira工单
- 显示PROJ-123
- 列出我的工单
- 将工单移至完成
- 当前冲刺中有什么
问题键检测
问题键遵循模式:[A-Z]+-[0-9]+(例如,PROJ-123,ABC-1)。
当用户在对话中提到问题键时:
- - CLI: jira issue view KEY 或 jira open KEY
- MCP: 使用键调用 mcpatlassianjiragetissue
工作流程
创建工单:
- 1. 如果用户引用代码/工单/PR,先研究上下文
- 起草工单内容
- 与用户一起审查
- 使用适当的后端创建
更新工单:
- 1. 首先获取问题详情
- 检查状态(注意进行中的工单)
- 显示当前与提议的变更
- 更新前获得批准
- 添加评论解释变更
任何操作之前
问问自己:
- 1. 当前状态是什么? — 始终先获取问题。不要假设状态、经办人或字段与用户认为的一致。
- 2. 还有谁受影响? — 检查关注者、关联问题、父史诗。一个简单的编辑可能会通知10个人。
- 3. 这是可逆的吗? — 状态转换可能有单向门。某些工作流需要中间状态。描述编辑没有撤销功能。
- 4. 我有正确的标识符吗? — 问题键、转换ID、账户ID。显示名称在分配时不起作用(MCP)。
绝对不要
- - 绝对不要在未获取当前状态的情况下进行转换 — 工作流可能需要中间状态。待办→完成如果必须先经过进行中可能会静默失败。
- - 绝对不要使用显示名称进行分配(MCP) — 只有账户ID有效。始终先调用 lookupJiraAccountId,否则分配会静默失败。
- - 绝对不要在未显示原文的情况下编辑描述 — Jira没有撤销功能。用户必须看到他们要替换的内容。
- - 绝对不要在缺少所有必填字段的情况下使用 --no-input(CLI) — 会以晦涩的错误信息静默失败。先检查项目的必填字段。
- - 绝对不要假设转换名称是通用的 — 完成、已关闭、已完成因项目而异。始终先获取可用的转换。
- - 绝对不要在未明确批准的情况下进行批量修改 — 每次工单变更都会通知关注者。10次编辑=10次通知风暴。
安全
- - 始终在运行命令/工具调用之前显示它
- 始终在修改工单之前获得批准
- 编辑时保留原始信息
- 应用后验证更新
- 始终清晰地呈现身份验证问题,以便用户解决
无可用后端
如果CLI和MCP都不可用,引导用户:
要使用Jira,您需要以下之一:
- 1. jira CLI(推荐):
https://github.com/ankitpokhrel/jira-cli
安装:brew install ankitpokhrel/jira-cli/jira-cli
设置:jira init
- 2. Atlassian MCP:
在您的MCP设置中使用Atlassian凭据进行配置。
深入阅读
在以下情况下加载参考文档:
- - 创建具有复杂字段或多行内容的问题
- 构建超出简单过滤器的JQL查询
- 排查错误或身份验证问题
- 处理转换、关联或冲刺
在以下情况下不要加载参考文档:
- - 简单的查看/列出操作(上面的快速参考已足够)
- 基本状态检查(jira issue view KEY)
- 在浏览器中打开问题
否 |
| 创建带描述的问题 |
是 — CLI需要 /tmp 模式 |
| 转换问题状态 |
是 — 需要转换ID工作流 |
| JQL搜索 |
是 — 用于复杂查询 |
| 关联问题 |
是 — MCP限制,需要脚本 |
参考文档:
- - CLI模式:references/commands.md
- MCP模式:references/mcp.md