search_test_cycles
Search test cycles in a Jira project using filters like status, priority, and assignee. Get paginated results with cycle IDs needed for subsequent test execution tools.
Instructions
Search test cycles in a project. Returns total count and paginated list with id, key, status, priority, archived. The 'id' field in results is the internal ID needed for execution tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Jira project numeric ID (e.g. 10011) | |
| folderId | No | Filter by folder ID | |
| status | No | Filter by status values | |
| priority | No | Filter by priority values | |
| assignee | No | Filter by assignee Jira account IDs | |
| query | No | Free-text search query | |
| startAt | No | Page offset (default 0) | |
| maxResults | No | Items per page (max 100, default 50) | |
| sort | No | Sort e.g. "id:asc" or "updated:desc" | |
| fields | No | Comma-separated fields to return |
Implementation Reference
- src/index.ts:374-389 (registration)Registration of the 'search_test_cycles' tool via the 'tool' helper wrapper, with its name, description, schema, and callback handler.
tool( "search_test_cycles", "Search test cycles in a project. Returns total count and paginated list with id, key, status, priority, archived. The 'id' field in results is the internal ID needed for execution tools.", { projectId: z.union([z.string(), z.number()]).describe("Jira project numeric ID (e.g. 10011)"), ...SearchFilters, ...Pagination, }, async ({ startAt, maxResults, sort, fields, projectId, ...filters }) => ok( await qtmFetch(`/testcycles/search${qs({ startAt, maxResults, sort, fields })}`, { method: "POST", body: JSON.stringify({ filter: { projectId, ...filters } }), }) ) ); - src/index.ts:378-381 (schema)Input schema for search_test_cycles: projectId (union string/number), plus shared SearchFilters (folderId, status, priority, assignee, query) and Pagination (startAt, maxResults, sort, fields).
projectId: z.union([z.string(), z.number()]).describe("Jira project numeric ID (e.g. 10011)"), ...SearchFilters, ...Pagination, }, - src/index.ts:382-389 (handler)Handler function that sends a POST request to /testcycles/search with the filter object containing projectId and optional filters, supporting pagination via query parameters.
async ({ startAt, maxResults, sort, fields, projectId, ...filters }) => ok( await qtmFetch(`/testcycles/search${qs({ startAt, maxResults, sort, fields })}`, { method: "POST", body: JSON.stringify({ filter: { projectId, ...filters } }), }) ) ); - src/index.ts:69-72 (helper)Helper function 'ok' used by the handler to wrap API responses into MCP tool content format.
function ok(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], }; - src/index.ts:76-83 (helper)Helper function 'qs' used by the handler to build query strings from optional pagination parameters.
function qs(params: Record<string, string | number | undefined>): string { const p = new URLSearchParams(); for (const [k, v] of Object.entries(params)) { if (v !== undefined) p.set(k, String(v)); } const s = p.toString(); return s ? `?${s}` : ""; }