jira-issues by skillcreatorai/ai-agent-skills
npx skills add https://github.com/skillcreatorai/ai-agent-skills --skill jira-issues使用 Jira REST API 或 MCP 创建和管理 Jira 问题。
安装 Jira MCP 服务器以实现无缝集成:
npx @anthropic-create-mcp-server jira
设置环境变量:
export JIRA_BASE_URL="https://yourcompany.atlassian.net"
export JIRA_EMAIL="your-email@company.com"
export JIRA_API_TOKEN="your-api-token"
获取您的 API 令牌:https://id.atlassian.com/manage-profile/security/api-tokens
import requests
from requests.auth import HTTPBasicAuth
import os
def create_issue(project_key, summary, description, issue_type="Task"):
url = f"{os.environ['JIRA_BASE_URL']}/rest/api/3/issue"
auth = HTTPBasicAuth(
os.environ['JIRA_EMAIL'],
os.environ['JIRA_API_TOKEN']
)
payload = {
"fields": {
"project": {"key": project_key},
"summary": summary,
"description": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": description}]
}]
},
"issuetype": {"name": issue_type}
}
}
response = requests.post(url, json=payload, auth=auth)
return response.json()
# 示例
issue = create_issue("PROJ", "Fix login bug", "Users can't login with SSO", "Bug")
print(f"Created: {issue['key']}")
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
def create_detailed_issue(project_key, summary, description,
issue_type="Task", priority="Medium",
labels=None, assignee=None):
payload = {
"fields": {
"project": {"key": project_key},
"summary": summary,
"description": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": description}]
}]
},
"issuetype": {"name": issue_type},
"priority": {"name": priority},
}
}
if labels:
payload["fields"]["labels"] = labels
if assignee:
payload["fields"]["assignee"] = {"accountId": assignee}
# ... 发起请求
| 类型 | 用途 |
|---|---|
| Bug | 某些功能损坏 |
| Task | 工作项 |
| Story | 面向用户的功能 |
| Epic | 大型计划 |
| Sub-task | 大型任务的一部分 |
def transition_issue(issue_key, transition_name):
# 获取可用的状态转换
url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/transitions"
transitions = requests.get(url, auth=auth).json()
# 查找匹配的转换
transition_id = None
for t in transitions['transitions']:
if t['name'].lower() == transition_name.lower():
transition_id = t['id']
break
# 执行状态转换
requests.post(url, json={"transition": {"id": transition_id}}, auth=auth)
def add_comment(issue_key, comment_text):
url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/comment"
payload = {
"body": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": comment_text}]
}]
}
}
requests.post(url, json=payload, auth=auth)
def search_issues(jql):
url = f"{JIRA_BASE_URL}/rest/api/3/search"
params = {"jql": jql, "maxResults": 50}
response = requests.get(url, params=params, auth=auth)
return response.json()['issues']
# 示例
my_bugs = search_issues("project = PROJ AND type = Bug AND assignee = currentUser()")
open_items = search_issues("project = PROJ AND status != Done")
recent = search_issues("project = PROJ AND created >= -7d")
当用户说...时,创建以下内容:
| 命令 | 操作 |
|---|---|
| "记录关于 X 的缺陷" | 带描述的缺陷问题 |
| "为 X 创建任务" | 任务问题 |
| "我有哪些待办事项" | JQL:assignee = currentUser() AND status != Done |
| "将 X 移至完成" | 将问题状态转换为 Done |
| "为 X 添加评论" | 为问题添加评论 |
每周安装量
141
代码仓库
GitHub 星标数
953
首次出现
2026年1月20日
安全审计
安装于
opencode121
gemini-cli119
codex115
cursor103
github-copilot103
claude-code98
Create and manage Jira issues using the Jira REST API or MCP.
Install the Jira MCP server for seamless integration:
npx @anthropic/create-mcp-server jira
Set environment variables:
export JIRA_BASE_URL="https://yourcompany.atlassian.net"
export JIRA_EMAIL="your-email@company.com"
export JIRA_API_TOKEN="your-api-token"
Get your API token: https://id.atlassian.com/manage-profile/security/api-tokens
import requests
from requests.auth import HTTPBasicAuth
import os
def create_issue(project_key, summary, description, issue_type="Task"):
url = f"{os.environ['JIRA_BASE_URL']}/rest/api/3/issue"
auth = HTTPBasicAuth(
os.environ['JIRA_EMAIL'],
os.environ['JIRA_API_TOKEN']
)
payload = {
"fields": {
"project": {"key": project_key},
"summary": summary,
"description": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": description}]
}]
},
"issuetype": {"name": issue_type}
}
}
response = requests.post(url, json=payload, auth=auth)
return response.json()
# Example
issue = create_issue("PROJ", "Fix login bug", "Users can't login with SSO", "Bug")
print(f"Created: {issue['key']}")
def create_detailed_issue(project_key, summary, description,
issue_type="Task", priority="Medium",
labels=None, assignee=None):
payload = {
"fields": {
"project": {"key": project_key},
"summary": summary,
"description": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": description}]
}]
},
"issuetype": {"name": issue_type},
"priority": {"name": priority},
}
}
if labels:
payload["fields"]["labels"] = labels
if assignee:
payload["fields"]["assignee"] = {"accountId": assignee}
# ... make request
| Type | Use For |
|---|---|
| Bug | Something broken |
| Task | Work item |
| Story | User-facing feature |
| Epic | Large initiative |
| Sub-task | Part of larger task |
def transition_issue(issue_key, transition_name):
# Get available transitions
url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/transitions"
transitions = requests.get(url, auth=auth).json()
# Find matching transition
transition_id = None
for t in transitions['transitions']:
if t['name'].lower() == transition_name.lower():
transition_id = t['id']
break
# Execute transition
requests.post(url, json={"transition": {"id": transition_id}}, auth=auth)
def add_comment(issue_key, comment_text):
url = f"{JIRA_BASE_URL}/rest/api/3/issue/{issue_key}/comment"
payload = {
"body": {
"type": "doc",
"version": 1,
"content": [{
"type": "paragraph",
"content": [{"type": "text", "text": comment_text}]
}]
}
}
requests.post(url, json=payload, auth=auth)
def search_issues(jql):
url = f"{JIRA_BASE_URL}/rest/api/3/search"
params = {"jql": jql, "maxResults": 50}
response = requests.get(url, params=params, auth=auth)
return response.json()['issues']
# Examples
my_bugs = search_issues("project = PROJ AND type = Bug AND assignee = currentUser()")
open_items = search_issues("project = PROJ AND status != Done")
recent = search_issues("project = PROJ AND created >= -7d")
When user says... create this:
| Command | Action |
|---|---|
| "log bug about X" | Bug issue with description |
| "create task for X" | Task issue |
| "what's on my plate" | JQL: assignee = currentUser() AND status != Done |
| "move X to done" | Transition issue to Done |
| "add comment to X" | Add comment to issue |
Weekly Installs
141
Repository
GitHub Stars
953
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode121
gemini-cli119
codex115
cursor103
github-copilot103
claude-code98
开源项目教练指南 - 诊断问题、制定行动计划、优化开源项目运营
43,100 周安装