get_test_execution
Retrieve detailed information about a specific test execution using its unique key, including all associated test runs for comprehensive test management and result tracking.
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 server tool handler for 'get_test_execution': extracts testExecutionKey from args, calls xrayClient.getTestExecution, and returns JSON stringified 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:196-209 (registration)Tool registration in the tools array: defines name 'get_test_execution', description, and inputSchema requiring testExecutionKey.{ 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.getTestExecution method: executes GraphQL query to fetch test execution by key using JQL, includes test runs details, handles not found error.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]; }