All skills

jira-integration

Official
by Api.AirforcePrepends a system promptBackend & APIs000 uses202,700

在检索Jira工单、分析需求、更新工单状态、添加评论或转换问题时使用此技能。通过MCP或直接REST调用提供Jira API模式。

open-sourceclaude-codebackend-apisaffaan-m
Share

What this skill does

When applied, it prepends a system prompt before your request is sent — no extra calls and no change to how you are billed beyond the added tokens.

---
name: jira-integration
description: 在检索Jira工单、分析需求、更新工单状态、添加评论或转换问题时使用此技能。通过MCP或直接REST调用提供Jira API模式。
origin: ECC
---

# Jira 集成技能

直接从 AI 编码工作流中检索、分析和更新 Jira 工单。支持 **基于 MCP**(推荐)和 **直接 REST API** 两种方式。

## 何时激活

* 获取 Jira 工单以理解需求
* 从工单中提取可测试的验收标准
* 向 Jira 问题添加进度评论
* 转换工单状态(待办 → 进行中 → 完成)
* 将合并请求或分支链接到 Jira 问题
* 通过 JQL 查询搜索问题

## 前提条件

### 选项 A:MCP 服务器(推荐)

安装 `mcp-atlassian` MCP 服务器。这将向您的 AI 代理直接暴露 Jira 工具。

**要求:**

* Python 3.10+
* `uvx`(来自 `uv`),通过您的包管理器或官方 `uv` 安装文档进行安装

**添加到您的 MCP 配置**(例如,`~/.claude.json` → `mcpServers`):

```json
{
  "jira": {
    "command": "uvx",
    "args": ["mcp-atlassian==0.21.0"],
    "env": {
      "JIRA_URL": "https://YOUR_ORG.atlassian.net",
      "JIRA_EMAIL": "[email protected]",
      "JIRA_API_TOKEN": "your-api-token"
    },
    "description": "Jira issue tracking — search, create, update, comment, transition"
  }
}
```

> **安全:** 切勿在源代码中硬编码密钥。建议在系统环境(或密钥管理器)中设置 `JIRA_URL`、`JIRA_EMAIL` 和 `JIRA_API_TOKEN`。仅对本地未提交的配置文件使用 MCP `env` 块。

**获取 Jira API 令牌:**

1. 访问 <https://id.atlassian.com/manage-profile/security/api-tokens>
2. 点击 **创建 API 令牌**
3. 复制令牌 — 将其存储在您的环境中,切勿存储在源代码中

### 选项 B:直接 REST API

如果 MCP 不可用,可通过 `curl` 或辅助脚本直接使用 Jira REST API v3。

**所需的环境变量:**

| 变量 | 描述 |
|----------|-------------|
| `JIRA_URL` | 您的 Jira 实例 URL(例如,`https://yourorg.atlassian.net`) |
| `JIRA_EMAIL` | 您的 Atlassian 账户邮箱 |
| `JIRA_API_TOKEN` | 来自 id.atlassian.com 的 API 令牌 |

将这些存储在您的 shell 环境、密钥管理器或未跟踪的本地环境文件中。不要将其提交到仓库。

对于直接 `curl` 示例,请通过标准输入传递 Jira 用户配置,避免凭据出现在命令行参数中。

```bash
jira_curl() {
  printf 'user = "%s:%s"\n' "$JIRA_EMAIL" "$JIRA_API_TOKEN" |
    curl -s -K - "$@"
}
```

## MCP 工具参考

当配置了 `mcp-atlassian` MCP 服务器时,以下工具可用:

| 工具 | 用途 | 示例 |
|------|---------|---------|
| `jira_search` | JQL 查询 | `project = PROJ AND status = "In Progress"` |
| `jira_get_issue` | 按键获取完整问题详情 | `PROJ-1234` |
| `jira_create_issue` | 创建问题(任务、缺陷、故事、史诗) | 新建缺陷报告 |
| `jira_update_issue` | 更新字段(摘要、描述、经办人) | 更改经办人 |
| `jira_transition_issue` | 更改状态 | 移至“评审中” |
| 

Use this skill

Per request

Add a "skill" field with the skill’s ID to your chat completion request. It is applied server-side before your prompt is sent — no extra calls.

{
  "model": "gpt-4o-mini",
  "skill": "imp-3c44c0ed-2936-47e7-9062-139133facf0d",
  "messages": [{ "role": "user", "content": "…" }]
}
Always on — no field to send

Install the skill, enable it in your dashboard and (optionally) limit it to specific models. It then applies automatically to every matching request — with no "skill" field to send each time.

Set it up in your dashboard