feat: 支持上传到需求、缺陷和任务的标准附件

Open
#14 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
api, cli

Research direction

Start in internal/cmd/attachment.go and trace runAttachmentUpload into the SDK's UploadAttachmentRequest model. Check TAPD Open API support for standard attachments on stories, bugs, and tasks, then verify the existing custom-field path and list behavior. Done means standard uploads work while custom-field uploads remain supported, or the command help and README clearly document the API limitation and alternative.

Written by the indexing model from the issue text.

Description

背景

当前 tapd attachment upload 命令强制要求 --custom-field,只能上传到 TAPD 的自定义字段附件。

从当前实现看:

  • internal/cmd/attachment.go--custom-field 标记为必填;
  • runAttachmentUpload 通过 SDK 的 UploadAttachmentRequest 发送 workspace_idtypecustom_fieldentry_id
  • SDK 的上传请求模型也将 custom_field 定义为必填,并将 type 示例限定为 story_custom_field

问题

TAPD Web 的需求/缺陷/任务详情页存在不依赖自定义字段的标准“附件”区域,但 CLI 没有办法上传到该区域。

例如:

tapd attachment upload \
  --workspace-id=<workspace_id> \
  --entry-id=<bug_id> \
  --type=bug \
  --custom-field=custom_field_one \
  --file=/path/to/video.mp4

该命令可以返回附件 ID,但附件会关联到自定义字段,而不是标准 Bug 附件列表。随后执行:

tapd attachment list --workspace-id=<workspace_id> --entry-id=<bug_id> --type=bug

无法看到该附件;在 TAPD Web 的标准“附件”区域也不可见。

期望行为

希望支持标准工作项附件上传,例如:

tapd attachment upload \
  --workspace-id=<workspace_id> \
  --entry-id=<bug_id> \
  --type=bug \
  --file=/path/to/video.mp4

或者提供明确区分两种目标的参数,例如:

  • 标准附件:--target=attachment
  • 自定义字段附件:--custom-field=<field>

同时保留现有自定义字段附件上传能力。

需要确认

如果 TAPD Open API 本身不支持需求/缺陷/任务的标准附件上传,也请在命令帮助和 README 中明确说明当前限制,并说明 CLI 推荐的替代方式。

影响

AI Agent 通过 CLI 创建带录屏、日志或复现材料的 Bug 时,容易误以为上传成功,但附件实际不会出现在用户查看的标准“附件”区域。

Dominant language
Go
Stars
57
Forks
14
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.