get_project_test_plans
Retrieve all test plans for a specific Jira project to manage testing workflows and track test coverage.
Instructions
Get all test plans for a specific project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | The Jira project key (e.g., "PROJ") | |
| maxResults | No | Maximum number of results to return |
Implementation Reference
- src/index.ts:750-763 (handler)MCP server tool handler for 'get_project_test_plans'. Extracts projectKey and optional maxResults from arguments, calls xrayClient.getTestPlansByProject, and returns JSON stringified result.case 'get_project_test_plans': { const result = await xrayClient.getTestPlansByProject( args.projectKey as string, args.maxResults as number | undefined ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:328-346 (schema)Input schema definition for the 'get_project_test_plans' tool, specifying required projectKey and optional maxResults.{ name: 'get_project_test_plans', description: 'Get all test plans for a specific project', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, maxResults: { type: 'number', description: 'Maximum number of results to return', default: 50, }, }, required: ['projectKey'], }, },
- src/index.ts:328-346 (registration)Registration of the 'get_project_test_plans' tool in the tools array used by ListToolsRequestHandler.{ name: 'get_project_test_plans', description: 'Get all test plans for a specific project', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, maxResults: { type: 'number', description: 'Maximum number of results to return', default: 50, }, }, required: ['projectKey'], }, },
- src/xray-client.ts:719-722 (helper)XrayClient helper method that builds JQL query for test plans in a project and delegates to searchTestPlans.async getTestPlansByProject(projectKey: string, maxResults: number = 50): Promise<any> { const jql = `project = '${projectKey}'`; return this.searchTestPlans(jql, maxResults); }
- src/xray-client.ts:684-714 (helper)Core helper method that executes GraphQL query to search test plans by JQL, fetching details including contained tests.async searchTestPlans(jql: string, maxResults: number = 50): Promise<any> { const query = ` query SearchTestPlans($jql: String!, $limit: Int!) { getTestPlans(jql: $jql, limit: $limit) { total start limit results { issueId projectId jira(fields: ["key", "summary", "description", "status", "created", "updated"]) tests(limit: 10) { total results { issueId jira(fields: ["key", "summary"]) } } } } } `; const variables = { jql, limit: maxResults }; const result = await this.graphqlRequest<{ getTestPlans: any }>(query, variables); return result.getTestPlans; }