create_test_set
Create a new test set in Xray Cloud to group related tests for organized test management and execution tracking.
Instructions
Create a new test set in Xray Cloud to group related tests
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | The test set description | |
| projectKey | Yes | The Jira project key (e.g., "PROJ") | |
| summary | Yes | The test set summary/title | |
| testIssueIds | No | Array of test issue IDs to include in this set |
Implementation Reference
- src/index.ts:386-412 (registration)Tool registration entry in the tools array defining name, description, and input schema for create_test_set{ name: 'create_test_set', description: 'Create a new test set in Xray Cloud to group related tests', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, summary: { type: 'string', description: 'The test set summary/title', }, description: { type: 'string', description: 'The test set description', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to include in this set', }, }, required: ['projectKey', 'summary'], }, },
- src/index.ts:389-411 (schema)Input schema defining parameters for create_test_set tool: projectKey, summary, optional description and testIssueIdsinputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, summary: { type: 'string', description: 'The test set summary/title', }, description: { type: 'string', description: 'The test set description', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to include in this set', }, }, required: ['projectKey', 'summary'], },
- src/index.ts:795-812 (handler)MCP server handler for create_test_set tool: constructs TestSet from input arguments and delegates execution to xrayClient.createTestSet, returns JSON resultcase 'create_test_set': { const testSet: TestSet = { projectKey: args.projectKey as string, summary: args.summary as string, description: args.description as string | undefined, testIssueIds: args.testIssueIds as string[] | undefined, }; const result = await xrayClient.createTestSet(testSet); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/xray-client.ts:775-825 (handler)Core handler in XrayClient class: executes GraphQL mutation to create a new test set in Xray Cloud, optionally adding test issues, and returns the created test set detailsasync createTestSet(testSet: TestSet): Promise<TestSetResponse> { const mutation = ` mutation CreateTestSet($jira: JSON!, $testIssueIds: [String]) { createTestSet(jira: $jira, testIssueIds: $testIssueIds) { testSet { issueId jira(fields: ["key", "summary"]) tests(limit: 100) { results { issueId jira(fields: ["key", "summary"]) } } } warnings } } `; const jiraFields: any = { fields: { project: { key: testSet.projectKey }, summary: testSet.summary, issuetype: { name: 'Test Set' } } }; if (testSet.description) { jiraFields.fields.description = testSet.description; } const variables: any = { jira: jiraFields }; if (testSet.testIssueIds && testSet.testIssueIds.length > 0) { variables.testIssueIds = testSet.testIssueIds; } const result = await this.graphqlRequest<{ createTestSet: any }>(mutation, variables); return { issueId: result.createTestSet.testSet.issueId, key: result.createTestSet.testSet.jira.key, tests: result.createTestSet.testSet.tests?.results || [] }; }