Skip to main content
Glama

create_test_execution

Create a new test execution in Xray Cloud to run tests, specifying project key, summary, test cases, and environments for test management and tracking.

Instructions

Create a new test execution in Xray Cloud to run tests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoThe test execution description
projectKeyYesThe Jira project key (e.g., "PROJ")
summaryYesThe test execution summary/title
testEnvironmentsNoArray of test environments (e.g., ["Chrome", "iOS"])
testIssueIdsNoArray of test issue IDs to include in this execution (e.g., ["10001", "10002"])

Implementation Reference

  • MCP tool handler for 'create_test_execution': parses arguments, constructs TestExecution, calls xrayClient.createTestExecution, and returns JSON response
    case 'create_test_execution': { const testExecution: TestExecution = { projectKey: args.projectKey as string, summary: args.summary as string, description: args.description as string | undefined, testIssueIds: args.testIssueIds as string[] | undefined, testEnvironments: args.testEnvironments as string[] | undefined, }; const result = await xrayClient.createTestExecution(testExecution); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Tool schema definition and registration in the tools list, including inputSchema for create_test_execution
    { name: 'create_test_execution', description: 'Create a new test execution in Xray Cloud to run tests', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The Jira project key (e.g., "PROJ")', }, summary: { type: 'string', description: 'The test execution summary/title', }, description: { type: 'string', description: 'The test execution description', }, testIssueIds: { type: 'array', items: { type: 'string' }, description: 'Array of test issue IDs to include in this execution (e.g., ["10001", "10002"])', }, testEnvironments: { type: 'array', items: { type: 'string' }, description: 'Array of test environments (e.g., ["Chrome", "iOS"])', }, }, required: ['projectKey', 'summary'], }, },
  • Core XrayClient implementation of createTestExecution: builds GraphQL mutation to create test execution issue with test issues and environments, returns TestExecutionResponse
    async createTestExecution(testExecution: TestExecution): Promise<TestExecutionResponse> { const mutation = ` mutation CreateTestExecution($jira: JSON!, $testIssueIds: [String], $testEnvironments: [String]) { createTestExecution(jira: $jira, testIssueIds: $testIssueIds, testEnvironments: $testEnvironments) { testExecution { issueId jira(fields: ["key", "summary"]) testRuns(limit: 100) { results { id status { name description } test { issueId jira(fields: ["key", "summary"]) } } } } warnings } } `; const jiraFields: any = { fields: { project: { key: testExecution.projectKey }, summary: testExecution.summary, issuetype: { name: 'Test Execution' } } }; if (testExecution.description) { jiraFields.fields.description = testExecution.description; } const variables: any = { jira: jiraFields }; if (testExecution.testIssueIds && testExecution.testIssueIds.length > 0) { variables.testIssueIds = testExecution.testIssueIds; } if (testExecution.testEnvironments && testExecution.testEnvironments.length > 0) { variables.testEnvironments = testExecution.testEnvironments; } const result = await this.graphqlRequest<{ createTestExecution: any }>(mutation, variables); return { issueId: result.createTestExecution.testExecution.issueId, key: result.createTestExecution.testExecution.jira.key, testRuns: result.createTestExecution.testExecution.testRuns.results }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/c4m3lblue-star/xray-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server