gitlink-cli/skills/gitlink-issue/references/gitlink-issue-batch-update.md

38 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# issue +batch-update
批量更新多个 Issue 的状态、优先级、里程碑、标签和负责人。使用服务端批量 API一次调用处理所有 Issue。
## 使用方法
```bash
# 预览变更(不实际修改)
gitlink-cli issue +batch-update --ids 10,20,30 --status closed --dry-run
# 批量更新状态
gitlink-cli issue +batch-update --ids 10,20,30 --status closed
# 批量更新多个字段
gitlink-cli issue +batch-update --ids 10,20,30 --status closed --milestone 5 --assignees 100,200
# 批量更新标签
gitlink-cli issue +batch-update --ids 10,20,30 --labels 1,2,3
```
## 参数
| 参数 | 短选项 | 必需 | 说明 |
|------|--------|------|------|
| `--ids` | `-i` | 是 | 逗号分隔的 Issue ID 列表 |
| `--status` | `-s` | 否 | 新状态: open 或 closed |
| `--priority` | `-p` | 否 | 优先级 ID |
| `--milestone` | `-m` | 否 | 里程碑 ID |
| `--labels` | `-l` | 否 | 逗号分隔的标签 ID |
| `--assignees` | `-a` | 否 | 逗号分隔的负责人用户 ID |
| `--dry-run` | | 否 | 仅预览,不实际修改 |
## API 端点
`PATCH /api/v1/{owner}/{repo}/issues/batch_update.json`
Body: `{"ids": [10, 20], "status_id": 5, "milestone_id": 3, ...}`