xray-mcp 1.2.2 → 1.2.4

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
@@ -141,9 +141,10 @@ npm run dev
141
141
  ```
142
142
 
143
143
  **Test Types:**
144
- - `Manual` - Structured manual tests (use Xray's built-in manual test steps)
144
+ - `Manual` - Creates Unstructured tests (maps to "Unstructured" for `add_manual_test_steps` compatibility)
145
145
  - `Unstructured` - Free-form text steps (use with `add_manual_test_steps` tool)
146
146
  - `Cucumber` - Gherkin/BDD scenarios
147
+ - `Generic` - Other test types
147
148
  - `Generic` - Generic automated tests
148
149
 
149
150
  #### Add Manual Test Steps
@@ -111,50 +111,55 @@ export class XrayClient {
111
111
  * Create a new test case using GraphQL mutation
112
112
  */
113
113
  async createTestCase(testCase) {
114
- const mutation = `
115
- mutation CreateTest($jira: JSON!, $testType: UpdateTestTypeInput) {
116
- createTest(jira: $jira, testType: $testType) {
117
- test {
114
+ // Step 1: Create the test without testType
115
+ const createMutation = `
116
+ mutation CreateTest($testIssueFields: CreateTestInput!) {
117
+ createTest(testIssueFields: $testIssueFields) {
118
+ testIssue {
118
119
  issueId
119
- jira(fields: ["key"])
120
+ key
120
121
  }
121
122
  warnings
122
123
  }
123
124
  }
124
125
  `;
125
- const jiraFields = {
126
- fields: {
127
- project: {
128
- key: testCase.projectKey
129
- },
130
- summary: testCase.summary,
131
- issuetype: {
132
- name: 'Test'
133
- }
134
- }
126
+ const testIssueFields = {
127
+ projectKey: testCase.projectKey,
128
+ summary: testCase.summary
135
129
  };
136
130
  if (testCase.description) {
137
- jiraFields.fields.description = testCase.description;
131
+ testIssueFields.description = testCase.description;
138
132
  }
139
133
  if (testCase.labels && testCase.labels.length > 0) {
140
- jiraFields.fields.labels = testCase.labels;
134
+ testIssueFields.labels = testCase.labels;
141
135
  }
142
136
  if (testCase.priority) {
143
- jiraFields.fields.priority = { name: testCase.priority };
137
+ testIssueFields.priority = testCase.priority;
144
138
  }
145
- const variables = {
146
- jira: jiraFields
147
- };
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
148
143
  if (testCase.testType) {
149
- variables.testType = {
150
- kind: testCase.testType
151
- };
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
+ });
152
158
  }
153
- const result = await this.graphqlRequest(mutation, variables);
154
159
  return {
155
- id: result.createTest.test.issueId,
156
- key: result.createTest.test.jira.key,
157
- self: `https://your-jira-instance.atlassian.net/browse/${result.createTest.test.jira.key}`
160
+ id: issueId,
161
+ key: issueKey,
162
+ self: `https://your-jira-instance.atlassian.net/browse/${issueKey}`
158
163
  };
159
164
  }
160
165
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray-mcp",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {