jira-fetcher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Jira Ticket Fetcher

Jira工单获取工具

Fetch Jira ticket details and trigger PRD planning workflow.
获取Jira工单详情并触发PRD规划工作流。

Prerequisites

前置条件

Set these environment variables:
  • JIRA_API_TOKEN
    : Personal access token for Jira Cloud authentication
  • JIRA_EMAIL
    : Your Atlassian account email address
  • JIRA_SITE_URL
    : Jira site URL (default:
    https://sozialinfo.atlassian.net
    )
设置以下环境变量:
  • JIRA_API_TOKEN
    : Jira Cloud认证用的个人访问令牌
  • JIRA_EMAIL
    : 你的Atlassian账户邮箱地址
  • JIRA_SITE_URL
    : Jira站点URL(默认值:
    https://sozialinfo.atlassian.net

Workflow

工作流

  1. Fetch ticket: Run fetch script with the ticket key
  2. Display ticket info: Show link, ticket ID, title, and description
  3. Trigger PRD skill: Immediately start PRD planning with ticket context
  1. 获取工单:使用工单密钥运行获取脚本
  2. 展示工单信息:显示链接、工单ID、标题和描述
  3. 触发PRD技能:基于工单上下文立即启动PRD规划

Step 1: Fetch Ticket

步骤1:获取工单

Execute fetch script:
bash
python3 scripts/fetch_jira_ticket.py <ticket-key>
The script returns JSON with:
  • key
    : Ticket ID (e.g., "PROJ-123")
  • link
    : Direct URL to the ticket
  • title
    : Ticket summary/title
  • description
    : Ticket description (may be in Atlassian Document Format)
Handle errors by returning the full API error message to the user.
执行获取脚本:
bash
python3 scripts/fetch_jira_ticket.py <ticket-key>
脚本会返回包含以下内容的JSON:
  • key
    : 工单ID(例如:"PROJ-123")
  • link
    : 工单的直接URL
  • title
    : 工单摘要/标题
  • description
    : 工单描述(可能采用Atlassian Document Format格式)
错误处理:将完整的API错误信息返回给用户。

Step 2: Display Ticket Info

步骤2:展示工单信息

Present the fetched information to the user in a clear format:
markdown
undefined
以清晰的格式向用户展示获取到的信息:
markdown
undefined

Jira Ticket: {key}

Jira Ticket: {key}

Link: {link} Title: {title}
Description: {description}
undefined
Link: {link} Title: {title}
Description: {description}
undefined

Step 3: Trigger PRD Skill

步骤3:触发PRD技能

After displaying the ticket, immediately start the PRD planning workflow:
  1. Inform the user: Briefly state that you're now creating a PRD based on the ticket
  2. Provide context: The PRD skill has access to the ticket details from Step 2
  3. Ask clarifying questions: Use the PRD skill's question format with ticket context in mind
Example PRD question:
Based on this ticket, what is the primary goal?
A. [Option based on ticket]
B. [Option based on ticket]
C. [Option based on ticket]
D. Other: [please specify]
The PRD skill will then generate a comprehensive PRD document with:
  • User stories and acceptance criteria
  • Functional requirements
  • Success metrics
  • Non-goals (out of scope)
展示工单后,立即启动PRD规划工作流:
  1. 告知用户:简要说明当前正在基于该工单创建PRD
  2. 提供上下文:PRD技能可访问步骤2中的工单详情
  3. 提出澄清问题:结合工单上下文,使用PRD技能的问题格式提问
PRD问题示例:
Based on this ticket, what is the primary goal?
A. [Option based on ticket]
B. [Option based on ticket]
C. [Option based on ticket]
D. Other: [please specify]
随后PRD技能将生成包含以下内容的完整PRD文档:
  • 用户故事与验收标准
  • 功能需求
  • 成功指标
  • 非目标(超出范围内容)

Important Notes

重要说明

  • No automatic PRD creation: Do NOT create the PRD automatically. Let the PRD skill handle its workflow (questions → generation)
  • Context availability: The PRD skill has full ticket context available when asking clarifying questions
  • Error handling: If the API call fails, return the exact error message from the API response
  • Description format: Jira descriptions may be in Atlassian Document Format (JSON); present this to the user as-is
  • 禁止自动创建PRD:不要自动创建PRD,让PRD技能处理其工作流(提问→生成)
  • 上下文可用性:PRD技能在提出澄清问题时可访问完整的工单上下文
  • 错误处理:如果API调用失败,返回API响应中的完整错误信息
  • 描述格式:Jira工单描述可能采用Atlassian Document Format(JSON)格式;直接原样展示给用户

Example Session

示例会话

User: "Fetch JIRA-123"
Agent:
  1. Runs
    python3 scripts/fetch_jira_ticket.py JIRA-123
  2. Displays ticket info (link, title, description)
  3. Says: "Now creating a PRD based on this ticket. I have the ticket context and will ask clarifying questions."
  4. Activates PRD skill and asks: "Based on this ticket about user authentication, what's the primary goal? A. Improve security, B. Simplify login, C. Add OAuth, D. Other"
用户:"获取JIRA-123"
Agent
  1. 运行
    python3 scripts/fetch_jira_ticket.py JIRA-123
  2. 展示工单信息(链接、标题、描述)
  3. 回复:"现在基于该工单创建PRD。我已获取工单上下文,接下来会提出澄清问题。"
  4. 激活PRD技能并提问:"基于这篇关于用户认证的工单,主要目标是什么?A. 提升安全性,B. 简化登录流程,C. 添加OAuth功能,D. 其他"