add_tests_to_test_plan
Add test cases to an existing test plan in Xray test management system to organize and group related tests for execution tracking.
Instructions
Add tests to an existing test plan
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testIssueIds | Yes | Array of test issue IDs to add | |
| testPlanIssueId | Yes | The test plan issue ID (not key) |
Implementation Reference
- src/index.ts:765-778 (handler)The MCP tool handler for 'add_tests_to_test_plan' that extracts input arguments and delegates to XrayClient.addTestsToTestPlan, returning the result as text content.case 'add_tests_to_test_plan': { const result = await xrayClient.addTestsToTestPlan( args.testPlanIssueId as string, args.testIssueIds as string[] ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:350-364 (schema)Input schema validation for the 'add_tests_to_test_plan' tool parameters.inputSchema: { type: 'object', properties: { testPlanIssueId: { type: 'string', description: 'The test plan issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testPlanIssueId', 'testIssueIds'], },
- src/index.ts:347-365 (registration)Registration of the 'add_tests_to_test_plan' tool in the MCP tools list, including name, description, and input schema.{ name: 'add_tests_to_test_plan', description: 'Add tests to an existing test plan', inputSchema: { type: 'object', properties: { testPlanIssueId: { type: 'string', description: 'The test plan issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testPlanIssueId', 'testIssueIds'], }, },
- src/xray-client.ts:727-744 (helper)Helper method in XrayClient that executes the GraphQL mutation to add tests to a test plan.async addTestsToTestPlan(testPlanIssueId: string, testIssueIds: string[]): Promise<any> { const mutation = ` mutation AddTestsToTestPlan($issueId: String!, $testIssueIds: [String]!) { addTestsToTestPlan(issueId: $issueId, testIssueIds: $testIssueIds) { addedTests warning } } `; const variables = { issueId: testPlanIssueId, testIssueIds }; const result = await this.graphqlRequest<{ addTestsToTestPlan: any }>(mutation, variables); return result.addTestsToTestPlan; }