Skip to main content
Glama

ado_create_work_item

Create new work items in Azure DevOps by specifying title, type, description, area path, iteration path, and custom fields to track development tasks and issues.

Instructions

Crea un nuevo Work Item en Azure DevOps. Usa ado_get_work_item_type_fields para ver campos requeridos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTítulo del Work Item
typeYesTipo de Work Item (User Story, Bug, Task, etc.)
descriptionNoDescripción del Work Item
areaPathNoRuta del área
iterationPathNoRuta del sprint/iteración
assignedToNoUsuario asignado
fieldsNoCampos adicionales como objeto {nombreCampo: valor}. Ej: {'Custom.OKR': 'valor'}

Implementation Reference

  • The handler implementation for the ado_create_work_item tool, which constructs a JSON patch document and calls the Azure DevOps createWorkItem API.
    async ({ title, type, description, areaPath, iterationPath, assignedTo, fields }) => {
      const api = await getWitApi();
    
      const patchDocument: VSSInterfaces.JsonPatchOperation[] = [
        {
          op: VSSInterfaces.Operation.Add,
          path: "/fields/System.Title",
          value: title,
        },
      ];
    
      if (description) {
        patchDocument.push({
          op: VSSInterfaces.Operation.Add,
          path: "/fields/System.Description",
          value: description,
        });
      }
    
      if (areaPath) {
        patchDocument.push({
          op: VSSInterfaces.Operation.Add,
          path: "/fields/System.AreaPath",
          value: areaPath,
        });
      }
    
      if (iterationPath) {
        patchDocument.push({
          op: VSSInterfaces.Operation.Add,
          path: "/fields/System.IterationPath",
          value: iterationPath,
        });
      }
    
      if (assignedTo) {
        patchDocument.push({
          op: VSSInterfaces.Operation.Add,
          path: "/fields/System.AssignedTo",
          value: assignedTo,
        });
      }
    
      // Agregar campos personalizados
      if (fields) {
        for (const [fieldName, value] of Object.entries(fields)) {
          patchDocument.push({
            op: VSSInterfaces.Operation.Add,
            path: `/fields/${fieldName}`,
            value: value,
          });
        }
      }
    
      const workItem = await api.createWorkItem(
        null,
        patchDocument,
        currentProject,
        type
      );
    
      return {
        content: [
          {
            type: "text",
            text: `Work Item creado exitosamente:\n${formatWorkItem(workItem)}`,
          },
        ],
      };
    }
  • src/index.ts:439-455 (registration)
    Tool registration for ado_create_work_item with input schema definition.
    server.tool(
      "ado_create_work_item",
      "Crea un nuevo Work Item en Azure DevOps. Usa ado_get_work_item_type_fields para ver campos requeridos.",
      {
        title: z.string().describe("Título del Work Item"),
        type: z
          .string()
          .describe("Tipo de Work Item (User Story, Bug, Task, etc.)"),
        description: z.string().optional().describe("Descripción del Work Item"),
        areaPath: z.string().optional().describe("Ruta del área"),
        iterationPath: z.string().optional().describe("Ruta del sprint/iteración"),
        assignedTo: z.string().optional().describe("Usuario asignado"),
        fields: z
          .record(z.string(), z.string())
          .optional()
          .describe("Campos adicionales como objeto {nombreCampo: valor}. Ej: {'Custom.OKR': 'valor'}"),
      },

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