Skip to main content
Glama

update_work_item

Modify Azure DevOps work items by updating fields and managing relationships between items to track project progress and dependencies.

Instructions

Updates a work item by its ID with field changes and relation management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsNoA list of relations to other work items.
updatesYesA dictionary of fields to update.
work_item_idYesThe ID of the work item to update.

Implementation Reference

  • Input schema and tool definition for 'update_work_item', defining required parameters work_item_id and updates, optional relations.
    types.Tool( name="update_work_item", description="Updates a work item by its ID with field changes and relation management.", inputSchema={ "type": "object", "properties": { "work_item_id": { "type": "integer", "description": "The ID of the work item to update." }, "updates": { "type": "object", "description": "A dictionary of fields to update." }, "relations": { "type": "array", "description": "A list of relations to other work items.", "items": { "type": "object", "properties": { "rel": { "type": "string", "description": "The relation type (e.g., 'System.LinkTypes.Dependency-Forward')." }, "url": { "type": "string", "description": "The URL of the related work item." } }, "required": ["rel", "url"] } } }, "required": ["work_item_id", "updates"], "additionalProperties": False } ),
  • MCP tool handler dispatch for 'update_work_item' in _execute_tool method, calls AzureDevOpsClient.update_work_item and returns formatted response with id, url, title, state.
    elif name == "update_work_item": work_item = self.client.update_work_item(**arguments) return { "id": work_item.id, "url": work_item.url, "title": work_item.fields.get('System.Title', 'N/A'), "state": work_item.fields.get('System.State', 'N/A') }
  • Core helper method implementing update_work_item logic: constructs JsonPatchOperation from updates dict and optional relations list, invokes Azure DevOps work_item_tracking_client.update_work_item API.
    def update_work_item(self, work_item_id, updates, relations=None): patch_document = [ JsonPatchOperation( op="add", path=f"/fields/{field}", value=value ) for field, value in updates.items() ] if relations: for relation in relations: patch_document.append( JsonPatchOperation( op="add", path="/relations/-", value={ "rel": relation["rel"], "url": relation["url"] } ) ) return self.work_item_tracking_client.update_work_item( document=patch_document, id=work_item_id )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xrmghost/mcp-azure-devops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server