get_test_execution
Retrieve detailed test execution results by key to analyze test runs and track testing progress within Xray Cloud.
Instructions
Get details of a specific test execution by key, including all test runs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testExecutionKey | Yes | The test execution key (e.g., "PROJ-456") |
Implementation Reference
- src/index.ts:647-657 (handler)MCP tool handler case for 'get_test_execution': extracts testExecutionKey from args, calls xrayClient.getTestExecution, and returns JSON-formatted result as text content.case 'get_test_execution': { const result = await xrayClient.getTestExecution(args.testExecutionKey as string); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:199-208 (schema)Input schema defining the required 'testExecutionKey' string parameter for the get_test_execution tool.inputSchema: { type: 'object', properties: { testExecutionKey: { type: 'string', description: 'The test execution key (e.g., "PROJ-456")', }, }, required: ['testExecutionKey'], },
- src/index.ts:196-209 (registration)Tool registration object in the 'tools' array, including name, description, and inputSchema, used by ListToolsRequestHandler.{ name: 'get_test_execution', description: 'Get details of a specific test execution by key, including all test runs', inputSchema: { type: 'object', properties: { testExecutionKey: { type: 'string', description: 'The test execution key (e.g., "PROJ-456")', }, }, required: ['testExecutionKey'], }, },
- src/xray-client.ts:467-509 (helper)XrayClient method implementing the core logic: GraphQL query to fetch specific test execution by key, including test runs details, with error if not found.async getTestExecution(testExecutionKey: string): Promise<any> { const query = ` query GetTestExecution($jql: String!, $limit: Int!) { getTestExecutions(jql: $jql, limit: $limit) { total results { issueId projectId jira(fields: ["key", "summary", "description", "status"]) testRuns(limit: 100) { results { id status { name description } test { issueId jira(fields: ["key", "summary"]) } startedOn finishedOn executedBy } } } } } `; const variables = { jql: `key = '${testExecutionKey}'`, limit: 1 }; const result = await this.graphqlRequest<{ getTestExecutions: any }>(query, variables); if (result.getTestExecutions.total === 0) { throw new Error(`Test execution ${testExecutionKey} not found`); } return result.getTestExecutions.results[0]; }