Adding new options to ProjectV2 fields via the API clears existing issue assignments #198803
-
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaAPI BodyWhat is the problem I am trying to solve?As product owner, I interact with projects and issues on the daily. Recently, I tried to automate two things with Claude using GraphQL:
Do other people recognise this behaviour? Are Claude and I overlooking something obvious, or is that just a drawback of the API? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
This is a known and painful behavior of the ProjectV2 API you are not missing anything obvious. When you call The safe pattern is to always read the existing options first, then include all of them plus your new addition in the update call never send just the new item alone. Think of it as a full replace operation, not an append. For sprint creation specifically across 30+ projects, the safer approach is using Before any field mutation touching production projects, pull the current field state with a query and store it. That gives you a restore point if something goes wrong which with this API behavior is genuinely easy to trigger. Worth filing this at If this helped, feel free to mark it as answered it helps others find the solution faster! 😊 |
Beta Was this translation helpful? Give feedback.
-
|
This sounds like expected behavior of the current GitHub Projects API rather than something Claude specifically did wrong. When you update project field configurations—especially single-select and iteration fields—the API can replace parts of the field definition rather than simply append to it. If existing project items reference values that are modified, renamed, recreated, or assigned new IDs, those item values can be cleared. I’ve seen similar reports with both single-select fields and iteration fields. The mutation succeeds, but existing assignments disappear because the underlying field options or iterations have effectively been replaced. The safest approach is:
Unfortunately, one of the drawbacks of automating Projects through GraphQL is that field configuration changes can have side effects that aren’t obvious from the mutation name alone. If you’re managing 30+ projects, I’d strongly recommend treating field updates as potentially destructive operations and validating them on a small test project before rolling them out broadly. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I’ve seen similar behavior. updateProjectV2Field modifies the field definition, and for iteration/single-select fields that can unintentionally clear existing values if options or iterations are changed or recreated. In practice, I treat field-level mutations as schema changes, not data changes. If possible, use item-level mutations for updating issue values and be very cautious when modifying iteration fields. Unfortunately, this seems more like a limitation/sharp edge of the current API than something Claude overlooked. |
Beta Was this translation helpful? Give feedback.
This is a known and painful behavior of the ProjectV2 API you are not missing anything obvious.
When you call
updateProjectV2Fieldto add a new option or iteration, GitHub replaces the entire field definition rather than appending to it. Any issue assignments referencing the old option IDs become orphaned because the IDs change with each update, effectively wiping all existing assignments.The safe pattern is to always read the existing options first, then include all of them plus your new addition in the update call never send just the new item alone. Think of it as a full replace operation, not an append.
For sprint creation specifically across 30+ projects, the safer approach is using
a…