get_test_case
Retrieve detailed information for a specific test case using its unique key to access test management data and execution details.
Instructions
Get details of a specific test case by key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testKey | Yes | The test case key (e.g., "PROJ-123") |
Implementation Reference
- src/xray-client.ts:278-316 (handler)Core handler function that executes GraphQL query to retrieve a specific test case by its key, including details like Jira fields, test type, steps, gherkin, and unstructured data.async getTestCase(testKey: string): Promise<any> { const query = ` query GetTest($jql: String!, $limit: Int!) { getTests(jql: $jql, limit: $limit) { total results { issueId projectId jira(fields: ["key", "summary", "description", "priority", "status", "labels"]) testType { name kind } steps { id action data result } gherkin unstructured } } } `; const variables = { jql: `key = '${testKey}'`, limit: 1 }; const result = await this.graphqlRequest<{ getTests: any }>(query, variables); if (result.getTests.total === 0) { throw new Error(`Test case ${testKey} not found`); } return result.getTests.results[0]; }
- src/index.ts:67-78 (schema)Input schema definition for the 'get_test_case' tool, specifying the required 'testKey' parameter.name: 'get_test_case', description: 'Get details of a specific test case by key', inputSchema: { type: 'object', properties: { testKey: { type: 'string', description: 'The test case key (e.g., "PROJ-123")', }, }, required: ['testKey'], },
- src/index.ts:554-564 (registration)Tool dispatch/registration in the main MCP tool call handler switch statement, which calls the xrayClient.getTestCase method and formats the response.case 'get_test_case': { const result = await xrayClient.getTestCase(args.testKey as string); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }