ado_update_work_item
Update existing Azure DevOps work items by modifying their title, state, assigned user, description, or custom fields to track project progress.
Instructions
Actualiza un Work Item existente en Azure DevOps
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID del Work Item a actualizar | |
| title | No | Nuevo título | |
| state | No | Nuevo estado (New, Active, Closed, etc.) | |
| assignedTo | No | Usuario asignado | |
| description | No | Nueva descripción | |
| fields | No | Campos adicionales como objeto {campo: valor} |
Implementation Reference
- src/index.ts:546-610 (handler)The handler function for 'ado_update_work_item', which constructs a patch document based on provided arguments and calls the Azure DevOps API to update the work item.
async ({ id, title, state, assignedTo, description, fields }) => { const api = await getWitApi(); const patchDocument: VSSInterfaces.JsonPatchOperation[] = []; if (title) { patchDocument.push({ op: VSSInterfaces.Operation.Add, path: "/fields/System.Title", value: title, }); } if (state) { patchDocument.push({ op: VSSInterfaces.Operation.Add, path: "/fields/System.State", value: state, }); } if (assignedTo) { patchDocument.push({ op: VSSInterfaces.Operation.Add, path: "/fields/System.AssignedTo", value: assignedTo, }); } if (description) { patchDocument.push({ op: VSSInterfaces.Operation.Add, path: "/fields/System.Description", value: description, }); } if (fields) { for (const [field, value] of Object.entries(fields)) { patchDocument.push({ op: VSSInterfaces.Operation.Add, path: `/fields/${field}`, value: value, }); } } if (patchDocument.length === 0) { throw new Error("Debe proporcionar al menos un campo para actualizar"); } const workItem = await api.updateWorkItem( null, patchDocument, id ); return { content: [ { type: "text", text: `Work Item actualizado exitosamente:\n${formatWorkItem(workItem)}`, }, ], }; - src/index.ts:532-545 (schema)Input schema for 'ado_update_work_item' using zod to validate id, title, state, assignedTo, description, and custom fields.
{ id: z.number().describe("ID del Work Item a actualizar"), title: z.string().optional().describe("Nuevo título"), state: z .string() .optional() .describe("Nuevo estado (New, Active, Closed, etc.)"), assignedTo: z.string().optional().describe("Usuario asignado"), description: z.string().optional().describe("Nueva descripción"), fields: z .record(z.string(), z.string()) .optional() .describe("Campos adicionales como objeto {campo: valor}"), }, - src/index.ts:529-531 (registration)Registration of the 'ado_update_work_item' tool with the MCP server.
server.tool( "ado_update_work_item", "Actualiza un Work Item existente en Azure DevOps",