update_test_case
Modify existing test cases by updating their summary, description, labels, or priority to maintain accurate and current testing documentation.
Instructions
Update an existing test case
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | New description for the test case | |
| labels | No | New labels for the test case | |
| priority | No | New priority for the test case | |
| summary | No | New summary/title for the test case | |
| testKey | Yes | The test case key (e.g., "PROJ-123") |
Implementation Reference
- src/xray-client.ts:324-331 (handler)The core handler function for updating a test case in XrayClient class. Currently throws an error explaining that direct updates are not supported via GraphQL and suggesting alternatives.async updateTestCase(testKey: string, updates: Partial<TestCase>): Promise<void> { throw new Error( 'Direct test case update is not supported via Xray GraphQL API. ' + 'Use Jira REST API to update standard fields (summary, description, labels, priority). ' + 'Use specific Xray mutations for test definition updates: ' + 'updateUnstructuredTestDefinition, updateGherkinTestDefinition, updateTestType, etc.' ); }
- src/index.ts:566-582 (handler)The MCP server tool execution handler (switch case) for 'update_test_case'. Prepares Partial<TestCase> from arguments and delegates to xrayClient.updateTestCase.case 'update_test_case': { const updates: Partial<TestCase> = {}; if (args.summary) updates.summary = args.summary as string; if (args.description) updates.description = args.description as string; if (args.labels) updates.labels = args.labels as string[]; if (args.priority) updates.priority = args.priority as string; await xrayClient.updateTestCase(args.testKey as string, updates); return { content: [ { type: 'text', text: `Test case ${args.testKey} updated successfully`, }, ], }; }
- src/index.ts:80-110 (registration)Registration of the 'update_test_case' tool in the tools array, including name, description, and input schema definition.{ name: 'update_test_case', description: 'Update an existing test case', inputSchema: { type: 'object', properties: { testKey: { type: 'string', description: 'The test case key (e.g., "PROJ-123")', }, summary: { type: 'string', description: 'New summary/title for the test case', }, description: { type: 'string', description: 'New description for the test case', }, labels: { type: 'array', items: { type: 'string' }, description: 'New labels for the test case', }, priority: { type: 'string', description: 'New priority for the test case', }, }, required: ['testKey'], }, },
- src/xray-client.ts:14-25 (schema)TypeScript interface TestCase used for typing the updates in updateTestCase function.export interface TestCase { id?: string; key?: string; summary: string; description?: string; testType?: 'Manual' | 'Cucumber' | 'Generic'; projectKey: string; labels?: string[]; components?: string[]; priority?: string; status?: string; }