xray-mcp 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -134,22 +134,21 @@ npm run dev
134
134
  "projectKey": "ABC",
135
135
  "summary": "Verify login functionality",
136
136
  "description": "Test that users can log in with valid credentials",
137
- "testType": "Unstructured",
137
+ "testType": "Manual",
138
138
  "labels": ["login", "authentication"],
139
139
  "priority": "High"
140
140
  }
141
141
  ```
142
142
 
143
143
  **Test Types:**
144
- - `Manual` - Creates Unstructured tests (maps to "Unstructured" for `add_manual_test_steps` compatibility)
145
- - `Unstructured` - Free-form text steps (use with `add_manual_test_steps` tool)
144
+ - `Manual` - Manual tests (default, use with `add_manual_test_steps` for unstructured steps)
146
145
  - `Cucumber` - Gherkin/BDD scenarios
147
146
  - `Generic` - Other test types
148
147
  - `Generic` - Generic automated tests
149
148
 
150
149
  #### Add Manual Test Steps
151
150
 
152
- **Important:** Test cases must be created with `testType: "Unstructured"` to use this tool.
151
+ **Important:** Test cases can use this tool regardless of test type.
153
152
 
154
153
  ```json
155
154
  {
@@ -169,7 +168,7 @@ npm run dev
169
168
  ```
170
169
 
171
170
  **Migration from Azure DevOps:** This tool is perfect for migrating test cases from ADO:
172
- 1. Create test case with `testType: "Unstructured"`
171
+ 1. Create test case with `testType: "Manual"` (default)
173
172
  2. Use the returned `issueId` with `add_manual_test_steps`
174
173
  3. Steps are formatted as pipe-delimited text: "1. Action|Data|Result"
175
174
 
package/dist/index.js CHANGED
@@ -37,9 +37,9 @@ const tools = [
37
37
  },
38
38
  testType: {
39
39
  type: 'string',
40
- enum: ['Unstructured', 'Manual', 'Cucumber', 'Generic'],
41
- description: 'The type of test case. Use "Unstructured" for free-form text steps (compatible with add_manual_test_steps)',
42
- default: 'Unstructured',
40
+ enum: ['Manual', 'Cucumber', 'Generic'],
41
+ description: 'The type of test case',
42
+ default: 'Manual',
43
43
  },
44
44
  labels: {
45
45
  type: 'array',
@@ -554,7 +554,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
554
554
  projectKey: args.projectKey,
555
555
  summary: args.summary,
556
556
  description: args.description,
557
- testType: args.testType || 'Unstructured',
557
+ testType: args.testType || 'Manual',
558
558
  labels: args.labels,
559
559
  priority: args.priority,
560
560
  };
@@ -12,7 +12,7 @@ export interface TestCase {
12
12
  key?: string;
13
13
  summary: string;
14
14
  description?: string;
15
- testType?: 'Unstructured' | 'Manual' | 'Cucumber' | 'Generic';
15
+ testType?: 'Manual' | 'Cucumber' | 'Generic';
16
16
  projectKey: string;
17
17
  labels?: string[];
18
18
  components?: string[];
@@ -111,55 +111,51 @@ export class XrayClient {
111
111
  * Create a new test case using GraphQL mutation
112
112
  */
113
113
  async createTestCase(testCase) {
114
- // Step 1: Create the test without testType
115
- const createMutation = `
116
- mutation CreateTest($testIssueFields: CreateTestInput!) {
117
- createTest(testIssueFields: $testIssueFields) {
118
- testIssue {
114
+ const mutation = `
115
+ mutation CreateTest($jira: JSON!, $testType: UpdateTestTypeInput, $unstructured: String) {
116
+ createTest(jira: $jira, testType: $testType, unstructured: $unstructured) {
117
+ test {
119
118
  issueId
120
- key
119
+ jira(fields: ["key"])
121
120
  }
122
121
  warnings
123
122
  }
124
123
  }
125
124
  `;
126
- const testIssueFields = {
127
- projectKey: testCase.projectKey,
128
- summary: testCase.summary
125
+ const jiraFields = {
126
+ fields: {
127
+ project: {
128
+ key: testCase.projectKey
129
+ },
130
+ summary: testCase.summary,
131
+ issuetype: {
132
+ name: 'Test'
133
+ }
134
+ }
129
135
  };
130
136
  if (testCase.description) {
131
- testIssueFields.description = testCase.description;
137
+ jiraFields.fields.description = testCase.description;
132
138
  }
133
139
  if (testCase.labels && testCase.labels.length > 0) {
134
- testIssueFields.labels = testCase.labels;
140
+ jiraFields.fields.labels = testCase.labels;
135
141
  }
136
142
  if (testCase.priority) {
137
- testIssueFields.priority = testCase.priority;
143
+ jiraFields.fields.priority = { name: testCase.priority };
138
144
  }
139
- const createResult = await this.graphqlRequest(createMutation, { testIssueFields });
140
- const issueId = createResult.createTest.testIssue.issueId;
141
- const issueKey = createResult.createTest.testIssue.key;
142
- // Step 2: Update test type if specified
145
+ const variables = {
146
+ jira: jiraFields,
147
+ unstructured: testCase.description || ''
148
+ };
143
149
  if (testCase.testType) {
144
- // Map "Manual" to "Unstructured" for ADO migration compatibility
145
- let xrayTestType = testCase.testType;
146
- if (testCase.testType === 'Manual') {
147
- xrayTestType = 'Unstructured';
148
- }
149
- const updateTypeMutation = `
150
- mutation UpdateTestType($issueId: String!, $testType: UpdateTestTypeInput!) {
151
- updateTestType(issueId: $issueId, testType: $testType)
152
- }
153
- `;
154
- await this.graphqlRequest(updateTypeMutation, {
155
- issueId,
156
- testType: { name: xrayTestType }
157
- });
150
+ variables.testType = {
151
+ name: testCase.testType
152
+ };
158
153
  }
154
+ const result = await this.graphqlRequest(mutation, variables);
159
155
  return {
160
- id: issueId,
161
- key: issueKey,
162
- self: `https://your-jira-instance.atlassian.net/browse/${issueKey}`
156
+ id: result.createTest.test.issueId,
157
+ key: result.createTest.test.jira.key,
158
+ self: `https://your-jira-instance.atlassian.net/browse/${result.createTest.test.jira.key}`
163
159
  };
164
160
  }
165
161
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray-mcp",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {