xray-mcp 1.2.3 → 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/dist/xray-client.js +28 -28
- package/package.json +1 -1
package/dist/xray-client.js
CHANGED
|
@@ -111,55 +111,55 @@ export class XrayClient {
|
|
|
111
111
|
* Create a new test case using GraphQL mutation
|
|
112
112
|
*/
|
|
113
113
|
async createTestCase(testCase) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
120
|
+
key
|
|
120
121
|
}
|
|
121
122
|
warnings
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
`;
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
131
|
+
testIssueFields.description = testCase.description;
|
|
138
132
|
}
|
|
139
133
|
if (testCase.labels && testCase.labels.length > 0) {
|
|
140
|
-
|
|
134
|
+
testIssueFields.labels = testCase.labels;
|
|
141
135
|
}
|
|
142
136
|
if (testCase.priority) {
|
|
143
|
-
|
|
137
|
+
testIssueFields.priority = testCase.priority;
|
|
144
138
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
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
144
|
// Map "Manual" to "Unstructured" for ADO migration compatibility
|
|
150
|
-
// add_manual_test_steps only works with Unstructured test type
|
|
151
145
|
let xrayTestType = testCase.testType;
|
|
152
146
|
if (testCase.testType === 'Manual') {
|
|
153
147
|
xrayTestType = 'Unstructured';
|
|
154
148
|
}
|
|
155
|
-
|
|
156
|
-
|
|
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
|
+
});
|
|
157
158
|
}
|
|
158
|
-
const result = await this.graphqlRequest(mutation, variables);
|
|
159
159
|
return {
|
|
160
|
-
id:
|
|
161
|
-
key:
|
|
162
|
-
self: `https://your-jira-instance.atlassian.net/browse/${
|
|
160
|
+
id: issueId,
|
|
161
|
+
key: issueKey,
|
|
162
|
+
self: `https://your-jira-instance.atlassian.net/browse/${issueKey}`
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
/**
|