tapd
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTAPD Skill
TAPD Skill
本 skill 提供与 TAPD 平台交互的 Python 脚本工具,统一通过 调用。
tapd.py本Skill提供与TAPD平台交互的Python脚本工具,统一通过 调用。
tapd.py环境配置
环境配置
使用前需要配置以下环境变量:
bash
export TAPD_ACCESS_TOKEN="你的个人访问令牌" # 推荐使用前需要配置以下环境变量:
bash
export TAPD_ACCESS_TOKEN="你的个人访问令牌" # 推荐或
或
export TAPD_API_USER="API账号"
export TAPD_API_PASSWORD="API密钥"
export TAPD_API_BASE_URL="https://api.tapd.cn" # 可选,默认
export TAPD_BASE_URL="https://www.tapd.cn" # 可选,默认
export CURRENT_USER_NICK="你的昵称" # 可选
undefinedexport TAPD_API_USER="API账号"
export TAPD_API_PASSWORD="API密钥"
export TAPD_API_BASE_URL="https://api.tapd.cn" # 可选,默认
export TAPD_BASE_URL="https://www.tapd.cn" # 可选,默认
export CURRENT_USER_NICK="你的昵称" # 可选
undefined使用方式
使用方式
bash
python scripts/tapd.py <command> [参数]所有命令默认输出 JSON 格式结果。
bash
python scripts/tapd.py <command> [参数]所有命令默认输出JSON格式结果。
命令列表
命令列表
项目与用户
项目与用户
| 命令 | 说明 |
|---|---|
| 获取用户参与的项目列表 |
| 获取项目信息 |
| 获取需求类别 |
| 命令 | 说明 |
|---|---|
| 获取用户参与的项目列表 |
| 获取项目信息 |
| 获取需求类别 |
需求/任务
需求/任务
| 命令 | 说明 |
|---|---|
| 查询需求/任务 |
| 创建需求/任务 |
| 更新需求/任务 |
| 获取数量 |
| 字段中英文对照 |
| 字段及候选值 |
| 命令 | 说明 |
|---|---|
| 查询需求/任务 |
| 创建需求/任务 |
| 更新需求/任务 |
| 获取数量 |
| 字段中英文对照 |
| 字段及候选值 |
缺陷
缺陷
| 命令 | 说明 |
|---|---|
| 查询缺陷 |
| 创建缺陷 |
| 更新缺陷 |
| 获取数量 |
| 命令 | 说明 |
|---|---|
| 查询缺陷 |
| 创建缺陷 |
| 更新缺陷 |
| 获取数量 |
迭代
迭代
| 命令 | 说明 |
|---|---|
| 查询迭代 |
| 创建迭代 |
| 更新迭代 |
| 命令 | 说明 |
|---|---|
| 查询迭代 |
| 创建迭代 |
| 更新迭代 |
评论
评论
| 命令 | 说明 |
|---|---|
| 查询评论 |
| 创建评论 |
| 更新评论 |
| 命令 | 说明 |
|---|---|
| 查询评论 |
| 创建评论 |
| 更新评论 |
附件/图片
附件/图片
| 命令 | 说明 |
|---|---|
| 获取附件 |
| 获取图片下载链接 |
| 命令 | 说明 |
|---|---|
| 获取附件 |
| 获取图片下载链接 |
自定义字段
自定义字段
| 命令 | 说明 |
|---|---|
| 获取自定义字段配置 |
| 命令 | 说明 |
|---|---|
| 获取自定义字段配置 |
工作流
工作流
| 命令 | 说明 |
|---|---|
| 状态映射 |
| 状态流转 |
| 结束状态 |
| 命令 | 说明 |
|---|---|
| 状态映射 |
| 状态流转 |
| 结束状态 |
测试用例
测试用例
| 命令 | 说明 |
|---|---|
| 查询测试用例 |
| 创建/更新测试用例 |
| 批量创建测试用例 |
| 命令 | 说明 |
|---|---|
| 查询测试用例 |
| 创建/更新测试用例 |
| 批量创建测试用例 |
Wiki
Wiki
| 命令 | 说明 |
|---|---|
| 查询 Wiki |
| 创建 Wiki |
| 更新 Wiki |
| 命令 | 说明 |
|---|---|
| 查询 Wiki |
| 创建 Wiki |
| 更新 Wiki |
工时
工时
| 命令 | 说明 |
|---|---|
| 查询工时 |
| 填写工时 |
| 更新工时 |
| 命令 | 说明 |
|---|---|
| 查询工时 |
| 填写工时 |
| 更新工时 |
待办
待办
| 命令 | 说明 |
|---|---|
| 获取待办 |
| 命令 | 说明 |
|---|---|
| 获取待办 |
关联
关联
| 命令 | 说明 |
|---|---|
| 获取关联缺陷 |
| 创建关联关系 |
| 命令 | 说明 |
|---|---|
| 获取关联缺陷 |
| 创建关联关系 |
发布计划
发布计划
| 命令 | 说明 |
|---|---|
| 获取发布计划 |
| 命令 | 说明 |
|---|---|
| 获取发布计划 |
源码
源码
| 命令 | 说明 |
|---|---|
| 获取提交关键字 |
| 命令 | 说明 |
|---|---|
| 获取提交关键字 |
消息
消息
| 命令 | 说明 |
|---|---|
| 发送企业微信消息 |
| 命令 | 说明 |
|---|---|
| 发送企业微信消息 |
使用示例
使用示例
查询需求
查询需求
bash
undefinedbash
undefined查询指定需求
查询指定需求
python scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --id 1167459320001114969
python scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --id 1167459320001114969
模糊搜索需求
模糊搜索需求
python scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --name "%登录%" --limit 20
python scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --name "%登录%" --limit 20
查询指定状态的需求
查询指定状态的需求
python scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --v_status "已验收"
undefinedpython scripts/tapd.py get_stories_or_tasks --workspace_id 123 --entity_type stories --v_status "已验收"
undefined创建需求
创建需求
bash
python scripts/tapd.py create_story_or_task --workspace_id 123 \
--name "用户登录功能" \
--description "## 需求描述\n用户可以通过账号密码登录系统" \
--priority_label "高" \
--owner "zhangsan" \
--iteration_name "Sprint 1"bash
python scripts/tapd.py create_story_or_task --workspace_id 123 \
--name "用户登录功能" \
--description "## 需求描述\n用户可以通过账号密码登录系统" \
--priority_label "高" \
--owner "zhangsan" \
--iteration_name "Sprint 1"更新需求状态
更新需求状态
bash
python scripts/tapd.py update_story_or_task --workspace_id 123 \
--id 1167459320001114969 \
--v_status "实现中"bash
python scripts/tapd.py update_story_or_task --workspace_id 123 \
--id 1167459320001114969 \
--v_status "实现中"查询缺陷
查询缺陷
bash
python scripts/tapd.py get_bug --workspace_id 123 --title "%登录失败%" --priority_label "高"bash
python scripts/tapd.py get_bug --workspace_id 123 --title "%登录失败%" --priority_label "高"创建缺陷
创建缺陷
bash
python scripts/tapd.py create_bug --workspace_id 123 \
--title "登录页面显示异常" \
--description "输入正确密码后提示错误" \
--priority_label "高" \
--severity "严重"bash
python scripts/tapd.py create_bug --workspace_id 123 \
--title "登录页面显示异常" \
--description "输入正确密码后提示错误" \
--priority_label "高" \
--severity "严重"迭代管理
迭代管理
bash
undefinedbash
undefined查询迭代
查询迭代
python scripts/tapd.py get_iterations --workspace_id 123
python scripts/tapd.py get_iterations --workspace_id 123
创建迭代
创建迭代
python scripts/tapd.py create_iteration --workspace_id 123
--name "Sprint 1"
--startdate "2024-01-01"
--enddate "2024-01-14"
--creator "zhangsan"
--name "Sprint 1"
--startdate "2024-01-01"
--enddate "2024-01-14"
--creator "zhangsan"
undefinedpython scripts/tapd.py create_iteration --workspace_id 123
--name "Sprint 1"
--startdate "2024-01-01"
--enddate "2024-01-14"
--creator "zhangsan"
--name "Sprint 1"
--startdate "2024-01-01"
--enddate "2024-01-14"
--creator "zhangsan"
undefined工时管理
工时管理
bash
undefinedbash
undefined查询工时
查询工时
python scripts/tapd.py get_timesheets --workspace_id 123 --entity_type story --entity_id 1167459320001114969
python scripts/tapd.py get_timesheets --workspace_id 123 --entity_type story --entity_id 1167459320001114969
填写工时
填写工时
python scripts/tapd.py add_timesheets --workspace_id 123
--entity_type story
--entity_id 1167459320001114969
--timespent "4"
--spentdate "2024-01-08"
--memo "开发登录功能"
--entity_type story
--entity_id 1167459320001114969
--timespent "4"
--spentdate "2024-01-08"
--memo "开发登录功能"
undefinedpython scripts/tapd.py add_timesheets --workspace_id 123
--entity_type story
--entity_id 1167459320001114969
--timespent "4"
--spentdate "2024-01-08"
--memo "开发登录功能"
--entity_type story
--entity_id 1167459320001114969
--timespent "4"
--spentdate "2024-01-08"
--memo "开发登录功能"
undefined评论管理
评论管理
bash
undefinedbash
undefined查询评论
查询评论
python scripts/tapd.py get_comments --workspace_id 123
--entry_type stories
--entry_id 1167459320001114969
--entry_type stories
--entry_id 1167459320001114969
python scripts/tapd.py get_comments --workspace_id 123
--entry_type stories
--entry_id 1167459320001114969
--entry_type stories
--entry_id 1167459320001114969
创建评论
创建评论
python scripts/tapd.py create_comments --workspace_id 123
--entry_type stories
--entry_id 1167459320001114969
--description "看起来不错,可以继续完善"
--entry_type stories
--entry_id 1167459320001114969
--description "看起来不错,可以继续完善"
undefinedpython scripts/tapd.py create_comments --workspace_id 123
--entry_type stories
--entry_id 1167459320001114969
--description "看起来不错,可以继续完善"
--entry_type stories
--entry_id 1167459320001114969
--description "看起来不错,可以继续完善"
undefined关联需求与缺陷
关联需求与缺陷
bash
undefinedbash
undefined查询需求关联的缺陷
查询需求关联的缺陷
python scripts/tapd.py get_related_bugs --workspace_id 123 --story_id 1167459320001114969
python scripts/tapd.py get_related_bugs --workspace_id 123 --story_id 1167459320001114969
创建关联
创建关联
python scripts/tapd.py entity_relations --workspace_id 123
--source_type story
--target_type bug
--source_id 1167459320001114969
--target_id 1167459320001114970
--source_type story
--target_type bug
--source_id 1167459320001114969
--target_id 1167459320001114970
undefinedpython scripts/tapd.py entity_relations --workspace_id 123
--source_type story
--target_type bug
--source_id 1167459320001114969
--target_id 1167459320001114970
--source_type story
--target_type bug
--source_id 1167459320001114969
--target_id 1167459320001114970
undefined工作流
工作流
bash
undefinedbash
undefined获取状态映射
获取状态映射
python scripts/tapd.py get_workflows_status_map --workspace_id 123 --system story
python scripts/tapd.py get_workflows_status_map --workspace_id 123 --system story
获取可流转状态
获取可流转状态
python scripts/tapd.py get_workflows_all_transitions --workspace_id 123 --system story
undefinedpython scripts/tapd.py get_workflows_all_transitions --workspace_id 123 --system story
undefined常用命令速查
常用命令速查
bash
undefinedbash
undefined需求
需求
python scripts/tapd.py get_stories_or_tasks --workspace_id $WS_ID --entity_type stories
python scripts/tapd.py create_story_or_task --workspace_id $WS_ID --name "标题"
python scripts/tapd.py update_story_or_task --workspace_id $WS_ID --id $ID --v_status "状态"
python scripts/tapd.py get_stories_or_tasks --workspace_id $WS_ID --entity_type stories
python scripts/tapd.py create_story_or_task --workspace_id $WS_ID --name "标题"
python scripts/tapd.py update_story_or_task --workspace_id $WS_ID --id $ID --v_status "状态"
缺陷
缺陷
python scripts/tapd.py get_bug --workspace_id $WS_ID
python scripts/tapd.py create_bug --workspace_id $WS_ID --title "标题"
python scripts/tapd.py get_bug --workspace_id $WS_ID
python scripts/tapd.py create_bug --workspace_id $WS_ID --title "标题"
迭代
迭代
python scripts/tapd.py get_iterations --workspace_id $WS_ID
python scripts/tapd.py create_iteration --workspace_id $WS_ID --name "Sprint X" --startdate "2024-01-01" --enddate "2024-01-14"
python scripts/tapd.py get_iterations --workspace_id $WS_ID
python scripts/tapd.py create_iteration --workspace_id $WS_ID --name "Sprint X" --startdate "2024-01-01" --enddate "2024-01-14"
工时
工时
python scripts/tapd.py add_timesheets --workspace_id $WS_ID --entity_type story --entity_id $ID --timespent 4 --spentdate "2024-01-08"
python scripts/tapd.py add_timesheets --workspace_id $WS_ID --entity_type story --entity_id $ID --timespent 4 --spentdate "2024-01-08"
评论
评论
python scripts/tapd.py create_comments --workspace_id $WS_ID --entry_type stories --entry_id $ID --description "评论内容"
undefinedpython scripts/tapd.py create_comments --workspace_id $WS_ID --entry_type stories --entry_id $ID --description "评论内容"
undefined状态值说明
状态值说明
| 类型 | 字段 | 可用值 |
|---|---|---|
| 需求优先级 | | High / Middle / Low / Nice To Have |
| 缺陷优先级 | | urgent / high / medium / low / insignificant |
| 缺陷严重程度 | | fatal / serious / normal / prompt / advice |
| 任务状态 | | open / progressing / done |
| 迭代状态 | | open / done |
| 类型 | 字段 | 可用值 |
|---|---|---|
| 需求优先级 | | High / Middle / Low / Nice To Have |
| 缺陷优先级 | | urgent / high / medium / low / insignificant |
| 缺陷严重程度 | | fatal / serious / normal / prompt / advice |
| 任务状态 | | open / progressing / done |
| 迭代状态 | | open / done |
Claude 使用方式
Claude 使用方式
当用户需要与 TAPD 交互时:
- 读取脚本:了解命令用法
- 构建命令:根据需求构建参数
- 执行脚本:使用 Bash 工具运行
- 处理结果:解析输出,分析数据
示例工作流:
用户: "查看需求 1167459320001114969 的详情"
Claude:
1. python scripts/tapd.py get_stories_or_tasks --workspace_id 67459320 --entity_type stories --id 1167459320001114969
2. 分析返回的需求信息当用户需要与 TAPD 交互时:
- 读取脚本:了解命令用法
- 构建命令:根据需求构建参数
- 执行脚本:使用 Bash 工具运行
- 处理结果:解析输出,分析数据
示例工作流:
用户: "查看需求 1167459320001114969 的详情"
Claude:
1. python scripts/tapd.py get_stories_or_tasks --workspace_id 67459320 --entity_type stories --id 1167459320001114969
2. 分析返回的需求信息图片处理
图片处理
当获取需求详情时, 命令会自动解析 description 中的图片并获取下载链接。
get_stories_or_tasks返回结果包含 字段:
imagesjson
{
"data": [
{
"Story": { "id": "1167459320001114969", "name": "需求标题", ... },
"images": [
{
"path": "/tfl/captures/2026-01/tapd_67459320_base64_1767668922_121.png",
"download_url": "https://file.tapd.cn/attachments/tmp_download/...?salt=...&time=...",
"filename": "tapd_67459320_base64_1767668922_121.png"
}
]
}
]
}处理步骤:
- 从返回结果中读取 数组
images - 使用 访问或下载图片
download_url - 图片链接有效期约 300 秒
手动获取图片(备用方式):
bash
undefined当获取需求详情时, 命令会自动解析 description 中的图片并获取下载链接。
get_stories_or_tasks返回结果包含 字段:
imagesjson
{
"data": [
{
"Story": { "id": "1167459320001114969", "name": "需求标题", ... },
"images": [
{
"path": "/tfl/captures/2026-01/tapd_67459320_base64_1767668922_121.png",
"download_url": "https://file.tapd.cn/attachments/tmp_download/...?salt=...&time=...",
"filename": "tapd_67459320_base64_1767668922_121.png"
}
]
}
]
}处理步骤:
- 从返回结果中读取 数组
images - 使用 访问或下载图片
download_url - 图片链接有效期约 300 秒
手动获取图片(备用方式):
bash
undefined如果需要单独获取某张图片
如果需要单独获取某张图片
python scripts/tapd.py get_image --workspace_id 67459320 --image_path "/tfl/captures/2026-01/tapd_xxx.png"
undefinedpython scripts/tapd.py get_image --workspace_id 67459320 --image_path "/tfl/captures/2026-01/tapd_xxx.png"
undefined文件结构
文件结构
scripts/
├── tapd.py # 统一入口脚本(43个子命令)
├── tapd_client.py # TAPD API 客户端
└── requirements.txtscripts/
├── tapd.py # 统一入口脚本(43个子命令)
├── tapd_client.py # TAPD API 客户端
└── requirements.txt