Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesID del Work Item a actualizar
titleNoNuevo título
stateNoNuevo estado (New, Active, Closed, etc.)
assignedToNoUsuario asignado
descriptionNoNueva descripción
fieldsNoCampos adicionales como objeto {campo: valor}

Implementation Reference

  • 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)}`,
          },
        ],
      };
  • 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",

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/soulberto/mcp-azure'

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