add_tests_to_test_set
Add test cases to an existing test set in Xray test management by providing test issue IDs and test set ID for organized test execution and tracking.
Instructions
Add tests to an existing test set
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testIssueIds | Yes | Array of test issue IDs to add | |
| testSetIssueId | Yes | The test set issue ID (not key) |
Implementation Reference
- src/xray-client.ts:915-932 (handler)Core handler function that executes the GraphQL mutation to add tests to a test set.async addTestsToTestSet(testSetIssueId: string, testIssueIds: string[]): Promise<any> { const mutation = ` mutation AddTestsToTestSet($issueId: String!, $testIssueIds: [String]!) { addTestsToTestSet(issueId: $issueId, testIssueIds: $testIssueIds) { addedTests warning } } `; const variables = { issueId: testSetIssueId, testIssueIds }; const result = await this.graphqlRequest<{ addTestsToTestSet: any }>(mutation, variables); return result.addTestsToTestSet; }
- src/index.ts:856-869 (handler)MCP tool dispatcher case that handles the tool call by delegating to xrayClient and formatting the response.case 'add_tests_to_test_set': { const result = await xrayClient.addTestsToTestSet( args.testSetIssueId as string, args.testIssueIds as string[] ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:466-483 (registration)Registers the tool in the tools array with name, description, and input schema for ListTools request.name: 'add_tests_to_test_set', description: 'Add tests to an existing test set', inputSchema: { type: 'object', properties: { testSetIssueId: { type: 'string', description: 'The test set issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testSetIssueId', 'testIssueIds'], }, },
- src/index.ts:468-482 (schema)Defines the input schema for the tool parameters.inputSchema: { type: 'object', properties: { testSetIssueId: { type: 'string', description: 'The test set issue ID (not key)', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to add', }, }, required: ['testSetIssueId', 'testIssueIds'], },