projects_write: add iterations to an existing iteration field (currently impossible without wiping item assignments)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- github, go, graphql
- 领域
- api, backend-api-design, tooling
调研方向
从 projects_write 的实现开始,尤其是现有的 create_iteration_field 路径,并检查 GraphQL ProjectV2Iteration 更新是如何组装的。将公共输入 schema 与读取侧的 iteration 类型,以及 issue 中描述的 single-select 选项标识行为进行比较。完成的标准是:现有的 iteration 字段可以安全地接收追加的 iteration,而不会丢失项目分配,并且外部 API 的限制和任何破坏性 fallback 都得到明确处理。
由索引模型根据 Issue 内容生成。
描述
Describe the feature or problem you’d like to solve
projects_write supports create_iteration_field (added in #2232, closing #1854), but there is no way to add an iteration to an existing iteration field — the single most common sprint operation ("add the next sprint").
Today, when an agent is asked to "add the next sprint to the Sprint field", the only iteration-related method available is create_iteration_field, so agents end up creating a duplicate field instead of appending to the existing one.
The underlying blocker is a public API asymmetry, which I verified empirically (2026-07-27):
- GraphQL: the only way to modify iterations is
updateProjectV2FieldwithiterationConfiguration, whose docs state "provided values overwrite the existing configuration". ItsProjectV2Iterationinput accepts only{startDate, duration, title}— noid, while the read-side typeProjectV2IterationFieldIterationdoes exposeid. - Consequence (tested on a disposable project): rebuilding the list with identical titles/dates regenerates all iteration ids (e.g.
18dd8506→3038b65f), and every item's iteration field value is silently cleared — for completed and active iterations alike. - REST: the new
projectsV2REST endpoints only allow creating fields (POST .../fields);fields/{field_id}has no PATCH/PUT, and the iteration items schema isadditionalProperties: falsewith noideither. - Precedent in the same mutation:
ProjectV2SingleSelectFieldOptionInputdoes have an optionalid, documented as "Include this to preserve the option's identity during updates, preventing item field values from being cleared". The GitHub web UI's internal endpoint uses exactly this pattern for iterations (existing entries carryid, new entries sendid: ""). Iterations appear to be the one place this mechanism was left out of the public schema.
Proposed solution
Two complementary parts:
- (Root fix, likely needs routing to the Projects/GraphQL team) Add an optional
id: Stringto theProjectV2Iterationinput, with the same preserve-identity semantics asProjectV2SingleSelectFieldOptionInput.id. This would make read-modify-write appends safe for any API consumer, not just MCP. - (This repo) Add an
add_iterationmethod toprojects_writethat appends an iteration to an existing iteration field (auto-computing the next start date from the last iteration when omitted). If/while the schema lacksid, the method could either (a) be gated with an explicit destructive warning, or (b) mitigate by snapshotting item assignments before the rewrite and re-assigning them to the regenerated ids afterwards.
This would benefit every team running sprint workflows through the MCP server: sprint planning is a recurring, high-frequency operation, and it is currently the one Projects v2 write that agents cannot perform safely at all.
Example prompts or workflows (for tools/toolsets only)
- "Add the next sprint to the Sprint field in project 14"
- "Extend our Sprint iterations through the end of Q4, two weeks each"
- "Create 'Sprint 23' starting 2026-10-03 with a duration of 14 days"
- "Our sprints ran out — add six more iterations matching the current cadence"
- "Insert next sprint and move all unfinished items from the current one into it"
Additional context
- Verification was done via schema introspection (
__typeonProjectV2Iteration,ProjectV2IterationFieldIteration,ProjectV2SingleSelectFieldOptionInput) and a live experiment on a throwaway user project; happy to share the exact GraphQL calls and before/after output. - Related: #1854 (closed by #2232, which covers field creation only).
- Public schema references (docs.github.com
schema.docs.graphql):input ProjectV2Iteration(no id) vstype ProjectV2IterationFieldIteration(has id);UpdateProjectV2FieldInput.iterationConfigurationoverwrite note;ProjectV2SingleSelectFieldOptionInput.idpreserve-identity note.
- 主要语言
- Go
- 星标
- 33.1k
- 派生
- 5k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 27
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/github-mcp-server 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
难度 1/5 1 小时以内 新手友好度 88/100
github/github-mcp-server#3042 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
github/github-mcp-server#3032 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 74/100
github/github-mcp-server#2803 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/registry#1654 ·
-
Type/Bug
难度 2/5 1-3 小时 新手友好度 78/100
OpenNSW/nsw-srilanka#497 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
milvus-io/birdwatcher#545 ·
-
kind/bug
难度 2/5 1-3 小时 新手友好度 88/100
kubernetes-sigs/prow#953 · 1 条评论 ·