Add optimistic concurrency guard to work item update tools #1410
Replies: 2 comments
-
|
I don't think this is something we are going to support right. At least until we get some more reqeuests for it. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the quick response. I understand not prioritizing this until there is more demand. That said, I’d like to highlight that I don’t see this as just a convenience feature. Without a revision guard, MCP-driven work item updates can silently overwrite changes made by another user in the meantime. In practice, this means the tool cannot guarantee data integrity for update workflows. Since Azure DevOps already supports the required backend behavior through a JSON Patch operation on /rev, even a minimal implementation would be valuable: an optional expectedRev parameter that fails the update when the item has changed. That would be enough to prevent silent overwrites, while keeping the current behavior unchanged when the parameter is not provided. I understand if this is not on the roadmap right now, but I believe this is an important safety gap for agent-driven write scenarios. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Enhance the existing Azure DevOps MCP work item update tools with optional
optimistic concurrency support so updates can fail safely instead of silently
overwriting work item changes made by another user.
Tools
Enhance the following existing tools with full parameter support, including
optional ones.
wit_update_work_item: Update fields on a single Azure DevOps work itemCurrent behavior updates fields by work item ID.
Add optional optimistic concurrency support:
expectedRev.expectedRevis provided, prepend the following JSON Patch operation tothe work item update request:
{ "op": "test", "path": "/rev", "value": 7 }Expected behavior:
expectedRev, apply the update normally.expectedRev, Azure DevOpsshould reject the update and no fields should be modified.
Example request:
{ "id": 12345, "expectedRev": 7, "updates": [ { "op": "replace", "path": "/fields/System.Description", "value": "Updated description" } ] }wit_update_work_items_batch: Update fields on multiple Azure DevOps work itemsCurrent behavior groups field updates by work item ID and sends them through the
Azure DevOps batch API.
Add optional optimistic concurrency support per work item:
expectedRev.expectedRevis provided for a work item, prepend the JSON Patch/revtest operation to that work item's PATCH body.
Expected behavior:
due to stale revision.
Remote MCP equivalents
Apply equivalent behavior to the remote grouped dispatcher if applicable.
wit_work_item_writewith actionupdateEquivalent to
wit_update_work_item.wit_work_item_writewith actionupdate_batchEquivalent to
wit_update_work_items_batch.Rules
expectedRevis not provided.op: "test"andpath: "/rev"whenexpectedRevis provided.so the check and update are atomic.
is not atomic because another user can update the work item between the fetch
and the write.
expectedRev, singlework item update with
expectedRev, batch update withoutexpectedRev,batch update with per-work-item
expectedRev, and stale revision failurehandling.
Beta Was this translation helpful? Give feedback.
All reactions