search_test_plans
Search test plans in a Jira project by providing the project ID. Returns paginated results with internal ID needed for linking test cycles. Filter by folder, status, priority, assignee, or free text query.
Instructions
Search test plans in a project. Returns total count and paginated list with id, key, projectId, archived. The 'id' field is the internal ID needed for linking cycles.
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:530-545 (registration)Registration of the 'search_test_plans' tool via the `tool()` wrapper which calls `server.registerTool()`.
tool( "search_test_plans", "Search test plans in a project. Returns total count and paginated list with id, key, projectId, archived. The 'id' field is the internal ID needed for linking cycles.", { 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(`/testplans/search${qs({ startAt, maxResults, sort, fields })}`, { method: "POST", body: JSON.stringify({ filter: { projectId, ...filters } }), }) ) ); - src/index.ts:538-544 (handler)Handler function for 'search_test_plans'. It sends a POST request to `/testplans/search` with pagination, sort, fields, and a filter containing projectId and other search filters.
async ({ startAt, maxResults, sort, fields, projectId, ...filters }) => ok( await qtmFetch(`/testplans/search${qs({ startAt, maxResults, sort, fields })}`, { method: "POST", body: JSON.stringify({ filter: { projectId, ...filters } }), }) ) - src/index.ts:533-537 (schema)Input schema for 'search_test_plans'. Requires projectId (string or number), spreads 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:157-163 (helper)SearchFilters object spread into the tool's schema, defining optional filter properties: folderId, status, priority, assignee, query.
const SearchFilters = { folderId: z.number().int().optional().describe("Filter by folder ID"), status: z.array(z.string()).optional().describe("Filter by status values"), priority: z.array(z.string()).optional().describe("Filter by priority values"), assignee: z.array(z.string()).optional().describe("Filter by assignee Jira account IDs"), query: z.string().optional().describe("Free-text search query"), }; - src/index.ts:144-155 (helper)Pagination object spread into the tool's schema, defining optional pagination properties: startAt, maxResults, sort, fields.
const Pagination = { startAt: z.number().int().min(0).optional().describe("Page offset (default 0)"), maxResults: z .number() .int() .min(1) .max(100) .optional() .describe("Items per page (max 100, default 50)"), sort: z.string().optional().describe('Sort e.g. "id:asc" or "updated:desc"'), fields: z.string().optional().describe("Comma-separated fields to return"), };