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 item
Current behavior updates fields by work item ID.
Add optional optimistic concurrency support:
- Add optional parameter:
expectedRev.
- When
expectedRev is provided, prepend the following JSON Patch operation to
the work item update request:
{
"op": "test",
"path": "/rev",
"value": 7
}
Expected behavior:
- If the current work item revision matches
expectedRev, apply the update normally.
- If the current work item revision does not match
expectedRev, Azure DevOps
should reject the update and no fields should be modified.
- Return a clear stale-update error message.
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 items
Current 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:
- Add optional parameter per update item or per grouped work item:
expectedRev.
- When
expectedRev is provided for a work item, prepend the JSON Patch /rev
test operation to that work item's PATCH body.
- Each work item should be guarded independently.
Expected behavior:
- A stale work item update should fail without modifying that work item.
- Other work item updates in the batch should preserve the existing batch behavior.
- The response should make it clear which work items succeeded and which failed
due to stale revision.
Remote MCP equivalents
Apply equivalent behavior to the remote grouped dispatcher if applicable.
wit_work_item_write with action update
Equivalent to wit_update_work_item.
wit_work_item_write with action update_batch
Equivalent to wit_update_work_items_batch.
Rules
- Adhere strictly to existing project standards and coding conventions.
- Preserve current behavior when
expectedRev is not provided.
- Use Azure DevOps JSON Patch revision testing with
op: "test" and
path: "/rev" when expectedRev is provided.
- Ensure the revision test and field updates are sent in the same PATCH request
so the check and update are atomic.
- Return a clear stale-update error when the revision check fails, for example:
Stale update: work item 12345 changed since expected revision 7. No fields were modified.
- Do not implement this as preflight fetch-and-compare only. A preflight check
is not atomic because another user can update the work item between the fetch
and the write.
- Add or update tests for single work item update without
expectedRev, single
work item update with expectedRev, batch update without expectedRev,
batch update with per-work-item expectedRev, and stale revision failure
handling.
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.