ado_query_sprint
Query user stories from a specific Azure DevOps sprint to track progress and filter by status for sprint planning and reporting.
Instructions
Consulta User Stories de un sprint específico en Azure DevOps
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iterationPath | Yes | Ruta del sprint (ej: 'Proyecto\Sprint1') | |
| state | No | Filtrar por estado (Active, New, Closed, etc.) |
Implementation Reference
- src/index.ts:269-303 (handler)The handler logic for 'ado_query_sprint' which executes a WIQL query against Azure DevOps to fetch user stories based on the iteration path and optional state.
async ({ iterationPath, state }) => { const api = await getWitApi(); const stateFilter = state ? ` AND [System.State] = '${state}'` : ""; const wiql: witInterfaces.Wiql = { query: `SELECT [System.Id], [System.Title], [System.State], [System.Tags] FROM WorkItems WHERE [System.WorkItemType] = 'User Story'${stateFilter} AND [System.IterationPath] UNDER '${iterationPath}' ORDER BY [System.Id]`, }; const teamContext = { project: currentProject }; const queryResult = await api.queryByWiql(wiql, teamContext); const workItemRefs = queryResult.workItems || []; if (workItemRefs.length === 0) { return { content: [ { type: "text", text: "No se encontraron Work Items en este sprint" }, ], }; } // Obtener detalles de los Work Items const ids = workItemRefs.map((wi) => wi.id!).filter((id): id is number => id !== undefined); const workItems = await api.getWorkItems( ids, ["System.Id", "System.Title", "System.State", "System.Tags"] ); const result = workItems .map((wi) => { const fields = wi.fields || {}; return `ID: ${wi.id} | ${fields["System.Title"]} | Estado: ${fields["System.State"]} | Tags: ${fields["System.Tags"] || "N/A"}`; }) .join("\n"); return { content: [{ type: "text", text: result || "Sin resultados" }], - src/index.ts:257-268 (registration)Registration of the 'ado_query_sprint' tool using the server.tool method, including schema definition for arguments 'iterationPath' and 'state'.
server.tool( "ado_query_sprint", "Consulta User Stories de un sprint específico en Azure DevOps", { iterationPath: z .string() .describe("Ruta del sprint (ej: 'Proyecto\\Sprint1')"), state: z .string() .optional() .describe("Filtrar por estado (Active, New, Closed, etc.)"), },