get_project_test_cases
Retrieve all test cases for a specific Jira project to support test management and quality assurance processes.
Instructions
Get all test cases for a specific project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | Maximum number of results to return | |
| projectKey | Yes | The Jira project key (e.g., "PROJ") |
Implementation Reference
- src/index.ts:611-624 (handler)MCP tool handler for 'get_project_test_cases': extracts projectKey and optional maxResults from arguments, calls xrayClient.getTestCasesByProject, and returns the result as JSON text content.case 'get_project_test_cases': { const result = await xrayClient.getTestCasesByProject( args.projectKey as string, args.maxResults as number | undefined ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:144-162 (schema)Input schema and tool definition for 'get_project_test_cases' registered in the tools list.{ name: 'get_project_test_cases', description: 'Get all test cases 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:357-360 (helper)Core implementation logic in XrayClient: constructs JQL query for the project and delegates to searchTestCases.async getTestCasesByProject(projectKey: string, maxResults: number = 50): Promise<any> { const jql = `project = '${projectKey}'`; return this.searchTestCases(jql, maxResults); }
- src/xray-client.ts:365-392 (helper)Supporting method searchTestCases that executes GraphQL query to fetch test cases matching the JQL query.async searchTestCases(jql: string, maxResults: number = 50): Promise<any> { const query = ` query SearchTests($jql: String!, $limit: Int!) { getTests(jql: $jql, limit: $limit) { total start limit results { issueId projectId jira(fields: ["key", "summary", "description", "priority", "status", "labels"]) testType { name kind } } } } `; const variables = { jql, limit: maxResults }; const result = await this.graphqlRequest<{ getTests: any }>(query, variables); return result.getTests; }