@smartbear/mcp 0.31.0 → 0.33.0

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.
Files changed (52) hide show
  1. package/dist/common/client-registry.js +19 -7
  2. package/dist/package.json.js +1 -1
  3. package/dist/qtm4j/client.js +14 -0
  4. package/dist/qtm4j/config/constants.js +83 -2
  5. package/dist/qtm4j/config/field-resolution.types.js +12 -2
  6. package/dist/qtm4j/http/api-client.js +30 -4
  7. package/dist/qtm4j/http/auth-service.js +3 -2
  8. package/dist/qtm4j/resolver/resolver-registry.js +37 -1
  9. package/dist/qtm4j/resolver/resolvers/build-resolver.js +51 -0
  10. package/dist/qtm4j/resolver/resolvers/common-attribute-resolver.js +1 -3
  11. package/dist/qtm4j/resolver/resolvers/component-resolver.js +1 -1
  12. package/dist/qtm4j/resolver/resolvers/defect-id-resolver.js +44 -0
  13. package/dist/qtm4j/resolver/resolvers/defect-priority-resolver.js +55 -0
  14. package/dist/qtm4j/resolver/resolvers/defect-status-resolver.js +55 -0
  15. package/dist/qtm4j/resolver/resolvers/environment-resolver.js +51 -0
  16. package/dist/qtm4j/resolver/resolvers/execution-context-resolver.js +58 -0
  17. package/dist/qtm4j/resolver/resolvers/label-resolver.js +1 -1
  18. package/dist/qtm4j/resolver/resolvers/requirement-id-resolver.js +3 -4
  19. package/dist/qtm4j/resolver/resolvers/step-execution-context-resolver.js +62 -0
  20. package/dist/qtm4j/resolver/resolvers/test-case-uid-resolver.js +3 -4
  21. package/dist/qtm4j/resolver/resolvers/test-cycle-uid-resolver.js +3 -4
  22. package/dist/qtm4j/schema/get-bugs.schema.js +101 -0
  23. package/dist/qtm4j/schema/get-test-case.schema.js +3 -3
  24. package/dist/qtm4j/schema/link-bugs.schema.js +63 -0
  25. package/dist/qtm4j/schema/start-execution.schema.js +45 -0
  26. package/dist/qtm4j/schema/test-cycle.link.schema.js +10 -1
  27. package/dist/qtm4j/schema/update-test-case-execution.schema.js +41 -0
  28. package/dist/qtm4j/schema/update-test-step-execution.schema.js +41 -0
  29. package/dist/qtm4j/tool/project/get-projects.js +3 -3
  30. package/dist/qtm4j/tool/project/set-project-context.js +1 -1
  31. package/dist/qtm4j/tool/test-automation/get-automation-history.js +4 -7
  32. package/dist/qtm4j/tool/test-automation/upload-automation-result.js +4 -2
  33. package/dist/qtm4j/tool/test-execution/get-test-case-bugs.js +119 -0
  34. package/dist/qtm4j/tool/test-execution/get-test-step-bugs.js +122 -0
  35. package/dist/qtm4j/tool/test-execution/link-test-case-bugs.js +135 -0
  36. package/dist/qtm4j/tool/test-execution/link-test-step-bugs.js +140 -0
  37. package/dist/qtm4j/tool/test-execution/start-execution.js +150 -0
  38. package/dist/qtm4j/tool/test-execution/update-test-case-execution.js +123 -0
  39. package/dist/qtm4j/tool/test-execution/update-test-step-execution.js +126 -0
  40. package/dist/swagger/client/api.js +8 -1
  41. package/dist/swagger/client/functional-testing-api.js +25 -0
  42. package/dist/swagger/client/functional-testing-tools.js +12 -2
  43. package/dist/swagger/client/functional-testing-types.js +29 -0
  44. package/dist/swagger/client/user-management-types.js +2 -1
  45. package/dist/swagger/client.js +7 -4
  46. package/dist/zephyr/client.js +3 -1
  47. package/dist/zephyr/common/rest-api-schemas.js +2876 -522
  48. package/dist/zephyr/common/utils.js +58 -14
  49. package/dist/zephyr/tool/test-case/update-test-case.js +37 -21
  50. package/dist/zephyr/tool/test-cycle/update-test-cycle.js +41 -25
  51. package/dist/zephyr/tool/test-plan/get-test-plans.js +65 -0
  52. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ import { ENDPOINTS } from "../../config/constants.js";
2
+ import { ResolverKeys } from "../../config/field-resolution.types.js";
3
+ import { Cache } from "../cache/cache.js";
4
+ import { Resolver } from "./resolver.js";
5
+ class EnvironmentResolver extends Resolver {
6
+ fieldKeys = [
7
+ ResolverKeys.SearchableField.ENVIRONMENT
8
+ ];
9
+ cache;
10
+ apiClient;
11
+ constructor(apiClient, cacheService) {
12
+ super();
13
+ this.apiClient = apiClient;
14
+ this.cache = new Cache(cacheService);
15
+ }
16
+ async resolve(inputField, resolverKey, body, context, warnings) {
17
+ const name = body[inputField];
18
+ if (name == null || typeof name === "number") return;
19
+ const trimmed = name.trim();
20
+ const id = await this.resolveAndReturn(
21
+ context.projectKey,
22
+ context.projectId,
23
+ resolverKey,
24
+ trimmed
25
+ );
26
+ if (id === void 0) {
27
+ delete body[inputField];
28
+ warnings.push(
29
+ `Skipped ${inputField} '${trimmed}' — not available in the current project.`
30
+ );
31
+ } else {
32
+ body[inputField] = Number(id);
33
+ }
34
+ }
35
+ async resolveAndReturn(projectKey, projectId, resolverKey, name) {
36
+ const trimmed = name.trim();
37
+ const cached = this.cache.matchValue(projectKey, resolverKey, trimmed);
38
+ if (cached !== void 0) return cached;
39
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.ENVIRONMENTS(projectId), {
40
+ search: trimmed
41
+ });
42
+ this.cache.set(projectKey, resolverKey, response);
43
+ return this.cache.matchValue(projectKey, resolverKey, trimmed);
44
+ }
45
+ clearCache(projectKey) {
46
+ this.cache.clear(projectKey);
47
+ }
48
+ }
49
+ export {
50
+ EnvironmentResolver
51
+ };
@@ -0,0 +1,58 @@
1
+ import { ENDPOINTS } from "../../config/constants.js";
2
+ import { ResolverKeys } from "../../config/field-resolution.types.js";
3
+ import { Cache } from "../cache/cache.js";
4
+ import { Resolver } from "./resolver.js";
5
+ class ExecutionContextResolver extends Resolver {
6
+ fieldKeys = [
7
+ ResolverKeys.SearchableField.EXECUTION_CONTEXT
8
+ ];
9
+ apiClient;
10
+ cache;
11
+ constructor(apiClient, cacheService) {
12
+ super();
13
+ this.apiClient = apiClient;
14
+ this.cache = new Cache(cacheService);
15
+ }
16
+ /** Builds the cache lookup name for a test case within a test cycle. */
17
+ buildCacheName(testCycleKey, testCaseKey) {
18
+ return `TestCycle:${testCycleKey}.TestCase:${testCaseKey}`.toLowerCase();
19
+ }
20
+ async resolve(_inputField, _resolverKey, _body, _context, _warnings) {
21
+ }
22
+ async resolveAndReturn(projectKey, projectId, testCycleKey, testCaseKeys) {
23
+ const result = {};
24
+ const uncachedKeys = [];
25
+ const resolverKey = ResolverKeys.SearchableField.EXECUTION_CONTEXT;
26
+ for (const testCaseKey of testCaseKeys) {
27
+ const name = this.buildCacheName(testCycleKey, testCaseKey);
28
+ const cached = this.cache.matchValue(projectKey, resolverKey, name);
29
+ if (cached === void 0) {
30
+ uncachedKeys.push(testCaseKey);
31
+ } else {
32
+ result[testCaseKey] = cached;
33
+ }
34
+ }
35
+ if (uncachedKeys.length === 0) {
36
+ return result;
37
+ }
38
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.EXECUTION_CONTEXT(projectId), {
39
+ testCycleKey,
40
+ testCaseKeys: uncachedKeys.join(",")
41
+ });
42
+ const fetched = response;
43
+ const values = {};
44
+ for (const [testCaseKey, entry] of Object.entries(fetched)) {
45
+ const name = this.buildCacheName(testCycleKey, testCaseKey);
46
+ values[name.toLowerCase()] = entry;
47
+ result[testCaseKey] = entry;
48
+ }
49
+ this.cache.set(projectKey, resolverKey, values);
50
+ return result;
51
+ }
52
+ clearCache(projectKey) {
53
+ this.cache.clear(projectKey);
54
+ }
55
+ }
56
+ export {
57
+ ExecutionContextResolver
58
+ };
@@ -43,7 +43,7 @@ class LabelResolver extends Resolver {
43
43
  async resolveAndReturn(projectKey, projectId, resolverKey, name) {
44
44
  const cached = this.cache.matchValue(projectKey, resolverKey, name);
45
45
  if (cached !== void 0) return cached;
46
- const response = await this.apiClient.get(ENDPOINTS.LABELS(projectId), {
46
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.LABELS(projectId), {
47
47
  search: name
48
48
  });
49
49
  this.cache.set(projectKey, resolverKey, response);
@@ -14,10 +14,9 @@ class RequirementIdResolver extends Resolver {
14
14
  }
15
15
  async resolveAndReturn(projectId, keys) {
16
16
  if (keys.length === 0) return {};
17
- const response = await this.apiClient.get(
18
- ENDPOINTS.RESOLVE_REQUIREMENT_IDS(projectId),
19
- { keys: keys.join(",") }
20
- );
17
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.RESOLVE_REQUIREMENT_IDS(projectId), {
18
+ keys: keys.join(",")
19
+ });
21
20
  return response;
22
21
  }
23
22
  clearCache(_projectKey) {
@@ -0,0 +1,62 @@
1
+ import { ENDPOINTS } from "../../config/constants.js";
2
+ import { ResolverKeys } from "../../config/field-resolution.types.js";
3
+ import { Cache } from "../cache/cache.js";
4
+ import { Resolver } from "./resolver.js";
5
+ class StepExecutionContextResolver extends Resolver {
6
+ fieldKeys = [
7
+ ResolverKeys.SearchableField.STEP_EXECUTION_CONTEXT
8
+ ];
9
+ apiClient;
10
+ cache;
11
+ constructor(apiClient, cacheService) {
12
+ super();
13
+ this.apiClient = apiClient;
14
+ this.cache = new Cache(cacheService);
15
+ }
16
+ /** Builds the cache lookup name for a step within a test case execution. */
17
+ buildCacheName(testCycleKey, testCaseKey, seqNo) {
18
+ return `TestCycle:${testCycleKey}.TestCase:${testCaseKey}.Step:${seqNo}`.toLowerCase();
19
+ }
20
+ async resolve(_inputField, _resolverKey, _body, _context, _warnings) {
21
+ }
22
+ async resolveAndReturn(projectKey, projectId, testCycleKey, testCaseKey, seqNos) {
23
+ const cachedSteps = {};
24
+ const uncachedSeqNos = [];
25
+ const resolverKey = ResolverKeys.SearchableField.STEP_EXECUTION_CONTEXT;
26
+ for (const seqNo of seqNos) {
27
+ const name = this.buildCacheName(testCycleKey, testCaseKey, seqNo);
28
+ const cached = this.cache.matchValue(projectKey, resolverKey, name);
29
+ if (cached === void 0) {
30
+ uncachedSeqNos.push(seqNo);
31
+ } else {
32
+ cachedSteps[seqNo] = Number(cached);
33
+ }
34
+ }
35
+ if (uncachedSeqNos.length === 0) {
36
+ return Object.keys(cachedSteps).length > 0 ? { [testCaseKey]: cachedSteps } : {};
37
+ }
38
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.STEP_EXECUTION_CONTEXT(projectId), {
39
+ testCycleKey,
40
+ testCaseKey,
41
+ seqNos: uncachedSeqNos.join(",")
42
+ });
43
+ const fetched = response;
44
+ const fetchedSteps = fetched[testCaseKey] ?? {};
45
+ const values = {};
46
+ for (const [seqNo, stepExecutionId] of Object.entries(fetchedSteps)) {
47
+ const name = this.buildCacheName(testCycleKey, testCaseKey, seqNo);
48
+ values[name] = String(stepExecutionId);
49
+ cachedSteps[Number(seqNo)] = stepExecutionId;
50
+ }
51
+ if (Object.keys(values).length > 0) {
52
+ this.cache.set(projectKey, resolverKey, values);
53
+ }
54
+ return Object.keys(cachedSteps).length > 0 ? { [testCaseKey]: cachedSteps } : {};
55
+ }
56
+ clearCache(projectKey) {
57
+ this.cache.clear(projectKey);
58
+ }
59
+ }
60
+ export {
61
+ StepExecutionContextResolver
62
+ };
@@ -14,10 +14,9 @@ class TestCaseUidResolver extends Resolver {
14
14
  }
15
15
  async resolveAndReturn(projectId, keys) {
16
16
  if (keys.length === 0) return {};
17
- const response = await this.apiClient.get(
18
- ENDPOINTS.RESOLVE_TEST_CASE_IDS(projectId),
19
- { keys: keys.join(",") }
20
- );
17
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.RESOLVE_TEST_CASE_IDS(projectId), {
18
+ keys: keys.join(",")
19
+ });
21
20
  return response;
22
21
  }
23
22
  clearCache(_projectKey) {
@@ -14,10 +14,9 @@ class TestCycleUidResolver extends Resolver {
14
14
  }
15
15
  async resolveAndReturn(projectId, keys) {
16
16
  if (keys.length === 0) return {};
17
- const response = await this.apiClient.get(
18
- ENDPOINTS.RESOLVE_TEST_CYCLE_IDS(projectId),
19
- { keys: keys.join(",") }
20
- );
17
+ const response = await this.apiClient.skipAnalytics().get(ENDPOINTS.RESOLVE_TEST_CYCLE_IDS(projectId), {
18
+ keys: keys.join(",")
19
+ });
21
20
  return response;
22
21
  }
23
22
  clearCache(_projectKey) {
@@ -0,0 +1,101 @@
1
+ import * as zod from "zod";
2
+ import { PAGINATION } from "../config/constants.js";
3
+ const testCycleKey = zod.string().describe(
4
+ "Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter."
5
+ );
6
+ const testCaseKey = zod.string().describe(
7
+ "Test case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'."
8
+ );
9
+ const status = zod.array(zod.string()).optional().describe(
10
+ "Bug status names to filter by (e.g. ['To Do', 'In Progress']). Auto-resolved to numeric IDs; unresolvable names are skipped with a warning."
11
+ );
12
+ const priority = zod.array(zod.string()).optional().describe(
13
+ "Bug priority names to filter by (e.g. ['High', 'Medium']). Auto-resolved to numeric IDs from project context; unresolvable names are skipped with a warning."
14
+ );
15
+ const startAt = zod.number().int().min(PAGINATION.DEFAULT_START_AT).default(PAGINATION.DEFAULT_START_AT).describe(
16
+ "Zero-based index of the first result to return (pagination offset)."
17
+ );
18
+ const maxResults = zod.number().int().min(
19
+ PAGINATION.MIN_ALLOWED_RESULTS,
20
+ `maxResults must be between ${PAGINATION.MIN_ALLOWED_RESULTS} and ${PAGINATION.MAX_ALLOWED_RESULTS_LINKED_BUGS}.`
21
+ ).max(
22
+ PAGINATION.MAX_ALLOWED_RESULTS_LINKED_BUGS,
23
+ `maxResults must be between ${PAGINATION.MIN_ALLOWED_RESULTS} and ${PAGINATION.MAX_ALLOWED_RESULTS_LINKED_BUGS}.`
24
+ ).default(PAGINATION.DEFAULT_MAX_RESULTS_LINKED_BUGS).describe(
25
+ `Maximum number of bugs to return per page. Range ${PAGINATION.MIN_ALLOWED_RESULTS}–${PAGINATION.MAX_ALLOWED_RESULTS_LINKED_BUGS}; defaults to ${PAGINATION.DEFAULT_MAX_RESULTS_LINKED_BUGS}.`
26
+ );
27
+ const level = zod.string().default("testcase_execution, teststep_execution").describe(
28
+ "Execution level filter. Default: 'testcase_execution, teststep_execution' (both levels). Use 'testcase_execution' for test-case-level links only, 'teststep_execution' for step-level links only."
29
+ );
30
+ const GetBugsFilter = zod.object({ priority, status }).describe(
31
+ "Filter criteria for linked bugs. Omit to return all linked bugs. priority and status names are resolved to numeric IDs; unresolvable names are skipped with a warning."
32
+ );
33
+ const GetTestCaseBugsBody = zod.object({
34
+ testCycleKey,
35
+ testCaseKey,
36
+ filter: GetBugsFilter.optional(),
37
+ level,
38
+ startAt,
39
+ maxResults
40
+ });
41
+ const GetTestStepBugsBody = zod.object({
42
+ testCycleKey,
43
+ testCaseKey,
44
+ testStepSeqNo: zod.number().int().positive("testStepSeqNo must be a positive integer.").describe(
45
+ "sequence number of the test step within the test case (e.g. 2 = the second step)."
46
+ ),
47
+ filter: GetBugsFilter.optional(),
48
+ startAt,
49
+ maxResults
50
+ });
51
+ const BugStatusSchema = zod.looseObject({
52
+ id: zod.number().describe("Numeric Jira status ID (e.g. 10000)."),
53
+ name: zod.string().describe("Status display name (e.g. 'To Do', 'Done')."),
54
+ color: zod.string().nullable().optional().describe("Status colour for UI display."),
55
+ description: zod.string().nullable().optional().describe("Status description."),
56
+ isDefault: zod.boolean().nullable().optional().describe("Whether this is the workflow's default status.")
57
+ });
58
+ const BugPrioritySchema = zod.looseObject({
59
+ id: zod.number().describe("Numeric Jira priority ID (e.g. 3)."),
60
+ name: zod.string().describe("Priority display name (e.g. 'High', 'Medium')."),
61
+ iconUrl: zod.string().optional().describe("URL of the priority icon."),
62
+ description: zod.string().nullable().optional().describe("Priority description."),
63
+ priorityIconId: zod.number().nullable().optional().describe("Internal priority icon ID."),
64
+ isDefault: zod.boolean().nullable().optional().describe("Whether this is the default priority.")
65
+ });
66
+ const BugIssueTypeSchema = zod.looseObject({
67
+ id: zod.number().describe("Numeric Jira issue type ID (e.g. 10004)."),
68
+ name: zod.string().describe("Issue type display name (e.g. 'Bug')."),
69
+ url: zod.string().optional().describe("URL of the issue type icon.")
70
+ });
71
+ const LinkedBugItemSchema = zod.looseObject({
72
+ id: zod.number().describe("Numeric Jira issue ID of the bug."),
73
+ key: zod.string().describe("Human-readable Jira issue key of the bug (e.g. 'PROJ-456')."),
74
+ summary: zod.string().optional().describe("Bug summary (title)."),
75
+ status: BugStatusSchema.optional().describe(
76
+ "Current Jira workflow status of the bug."
77
+ ),
78
+ priority: BugPrioritySchema.nullable().optional().describe("Bug priority. Null when no priority is set."),
79
+ issueType: BugIssueTypeSchema.optional().describe("Bug issue type."),
80
+ stepSeqNo: zod.number().nullable().optional().describe(
81
+ "step sequence number when the bug is linked at the test step level; null for test-case-level links."
82
+ ),
83
+ level: zod.string().optional().describe("Link level: 'testcase_execution' or 'teststep_execution'."),
84
+ parameterGroup: zod.number().nullable().optional().describe(
85
+ "Parameter set index for data-driven executions; null otherwise."
86
+ )
87
+ });
88
+ const GetBugsResponse = zod.object({
89
+ startAt: zod.number().describe("Zero-based index of the first item in this page."),
90
+ maxResults: zod.number().describe("Page size applied to this response."),
91
+ total: zod.number().describe(
92
+ "Total number of linked bugs matching the filter across all pages. 0 means none are linked."
93
+ ),
94
+ data: zod.array(LinkedBugItemSchema).describe("Linked bugs on the current page; empty when total is 0.")
95
+ });
96
+ export {
97
+ GetBugsFilter,
98
+ GetBugsResponse,
99
+ GetTestCaseBugsBody,
100
+ GetTestStepBugsBody
101
+ };
@@ -104,9 +104,9 @@ const ComponentSchema = zod.object({
104
104
  id: zod.number().optional()
105
105
  });
106
106
  const TestCaseSchema = zod.object({
107
- id: zod.string().describe("Internal test case ID"),
108
- key: zod.string().describe("Test case key, e.g. 'SCRUM-TC-145'"),
109
- summary: zod.string().describe("Test case title"),
107
+ id: zod.string().optional().describe("Internal test case ID"),
108
+ key: zod.string().optional().describe("Test case key, e.g. 'SCRUM-TC-145'"),
109
+ summary: zod.string().nullable().optional().describe("Test case title"),
110
110
  description: zod.string().nullable().optional(),
111
111
  priority: PrioritySchema.optional(),
112
112
  status: StatusSchema.optional(),
@@ -0,0 +1,63 @@
1
+ import * as zod from "zod";
2
+ const testCycleKey = zod.string().describe(
3
+ "Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter."
4
+ );
5
+ const testCaseKey = zod.string().describe(
6
+ "Test case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'."
7
+ );
8
+ const defectIDs = zod.array(zod.string().min(1)).transform((arr) => [...new Set(arr)]).describe(
9
+ "Jira issue keys of the bugs to link (e.g. ['PROJ-456', 'PROJ-789']). Pass Jira keys — not numeric IDs. Required if filter.jql is not provided; duplicates removed automatically."
10
+ );
11
+ const returnLinkedDefectCount = zod.boolean().default(true).describe(
12
+ "When true, the response includes linkedDefectCount (the number of bugs linked). Defaults to true."
13
+ );
14
+ const filter = zod.object({
15
+ jql: zod.string().describe(
16
+ "JQL expression to filter which bugs are linked (e.g. 'project = PROJ AND issuetype = Bug'). Passed through to the API unchanged — correct or normalize JQL before calling this tool."
17
+ )
18
+ }).optional().describe(
19
+ "JQL filter to select which bugs should be linked. Use instead of or in addition to defectIDs."
20
+ );
21
+ const LinkTestCaseBugsBody = zod.object({
22
+ testCycleKey,
23
+ testCaseKey,
24
+ defectIDs: defectIDs.optional(),
25
+ filter,
26
+ returnLinkedDefectCount
27
+ }).refine((data) => data.defectIDs?.length || data.filter?.jql, {
28
+ message: "At least one of defectIDs or filter.jql must be provided.",
29
+ path: ["defectIDs"]
30
+ });
31
+ const LinkTestStepBugsBody = zod.object({
32
+ testCycleKey,
33
+ testCaseKey,
34
+ testStepSeqNo: zod.number().int().positive("testStepSeqNo must be a positive integer.").describe(
35
+ "sequence number of the test step within the test case (e.g. 2 = the second step)."
36
+ ),
37
+ defectIDs: defectIDs.optional(),
38
+ filter,
39
+ returnLinkedDefectCount
40
+ }).refine((data) => data.defectIDs?.length || data.filter?.jql, {
41
+ message: "At least one of defectIDs or filter.jql must be provided.",
42
+ path: ["defectIDs"]
43
+ });
44
+ const LinkBugsResponse = zod.object({
45
+ testCycleKey: zod.string().describe(
46
+ "Test cycle Key of the execution the bugs were linked to (e.g. 'SCRUM-TR-101')."
47
+ ),
48
+ testCaseKey: zod.string().describe(
49
+ "Test case key of the execution the bugs were linked to (e.g. 'SCRUM-TC-145')."
50
+ ),
51
+ linked: zod.literal(true).describe("True — confirms the link request was accepted."),
52
+ linkedDefectCount: zod.number().optional().describe(
53
+ "Number of bugs successfully linked. Present when returnLinkedDefectCount is true (default)."
54
+ ),
55
+ warningMessages: zod.array(zod.string()).optional().describe(
56
+ "Per-bug warnings reported by the server (e.g. a bug key not accessible in Jira). Present only when issues occurred; the remaining bugs are still linked."
57
+ )
58
+ });
59
+ export {
60
+ LinkBugsResponse,
61
+ LinkTestCaseBugsBody,
62
+ LinkTestStepBugsBody
63
+ };
@@ -0,0 +1,45 @@
1
+ import * as zod from "zod";
2
+ const DATE_REGEX = /^\d{2}\/[A-Z][a-z]{2}\/\d{4}$/;
3
+ const ACTUAL_TIME_REGEX = /^\d+:[0-5]\d:[0-5]\d$/;
4
+ const StartExecutionBody = zod.object({
5
+ testCycleKey: zod.string().min(1).describe(
6
+ "Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter."
7
+ ),
8
+ testCaseKey: zod.string().min(1).describe(
9
+ "Test case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'."
10
+ ),
11
+ assignee: zod.string().optional().describe(
12
+ "Jira account ID of the user to assign this execution to (e.g. '5e4a642c1c9d440008f2a2b4'). This is the account ID, not a display name."
13
+ ),
14
+ executionPlannedDate: zod.string().regex(DATE_REGEX).optional().describe(
15
+ "Planned execution date. Format: 'dd/MMM/yyyy' e.g. '15/Oct/2025'. Month must be capitalised (Oct, not oct or OCT)."
16
+ ),
17
+ environmentId: zod.string().optional().describe(
18
+ "Environment name (e.g. 'Production', 'Staging', 'Google Chrome', 'Firefox'). Auto-resolved to its numeric ID; an unresolved name is dropped and a warning is returned."
19
+ ),
20
+ buildId: zod.string().optional().describe(
21
+ "Build name (e.g. 'Build 2.0', '1.0.0'). Auto-resolved to its numeric ID; an unresolved name is dropped and a warning is returned."
22
+ ),
23
+ actualTime: zod.string().regex(ACTUAL_TIME_REGEX, "Use 'HH:mm:ss' e.g. '02:30:00'.").optional().describe(
24
+ "Time already spent on the execution. Format: 'HH:mm:ss' e.g. '02:30:00' (2 hours 30 minutes 0 seconds)."
25
+ ),
26
+ cloneFrom: zod.number().int().nonnegative("cloneFrom must be a non-negative integer.").optional().describe(
27
+ "Source testCaseExecutionId to clone. When set, the new execution copies the source's execution and all other body fields are ignored by the server."
28
+ ),
29
+ cloneExecutionCustomFields: zod.boolean().optional().describe(
30
+ "When true, custom field values from the previous execution of this test case are copied into the new execution."
31
+ )
32
+ });
33
+ const StartExecutionResponse = zod.object({
34
+ testCycleKey: zod.string().describe(
35
+ "Key of the test cycle in which the execution was created (e.g. 'SCRUM-TR-101')."
36
+ ),
37
+ testCaseKey: zod.string().describe("Test case key of the created execution (e.g. 'SCRUM-TC-145')."),
38
+ created: zod.literal(true).describe(
39
+ "True when the server returned 204 No Content, confirming the execution was created successfully."
40
+ )
41
+ });
42
+ export {
43
+ StartExecutionBody,
44
+ StartExecutionResponse
45
+ };
@@ -175,7 +175,16 @@ const TestCycleExecutionSchema = zod__default.object({
175
175
  key: zod__default.string().optional().describe("Test case key (e.g., 'SCRUM-TC-145')."),
176
176
  summary: zod__default.string().optional().describe("Test case summary."),
177
177
  description: zod__default.string().nullable().optional(),
178
- executionResult: zod__default.string().nullable().optional().describe("Execution result (e.g., 'Pass', 'Fail', 'Blocked')."),
178
+ executionResult: zod__default.union([
179
+ zod__default.object({
180
+ id: zod__default.number().optional(),
181
+ name: zod__default.string().optional(),
182
+ color: zod__default.string().optional()
183
+ }),
184
+ zod__default.string()
185
+ ]).nullable().optional().describe(
186
+ "Execution result object (e.g., { id, name, color }) or string label."
187
+ ),
179
188
  status: zod__default.any().optional().describe("Test case status."),
180
189
  priority: zod__default.any().optional().describe("Test case priority."),
181
190
  environment: zod__default.string().nullable().optional(),
@@ -0,0 +1,41 @@
1
+ import * as zod from "zod";
2
+ const DATE_REGEX = /^\d{2}\/[A-Z][a-z]{2}\/\d{4}$/;
3
+ const ACTUAL_TIME_REGEX = /^\d+:[0-5]\d:[0-5]\d$/;
4
+ const UpdateTestCaseExecutionBody = zod.object({
5
+ testCycleKey: zod.string().describe(
6
+ "Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter."
7
+ ),
8
+ testCaseKey: zod.string().describe(
9
+ "Test case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'."
10
+ ),
11
+ executionResultId: zod.string().optional().describe(
12
+ "Execution result name, e.g. 'Pass', 'Fail', 'Blocked', 'In Progress', 'Not Executed'. Project-specific (custom results allowed); resolved case-insensitively to a numeric executionResultId."
13
+ ),
14
+ comment: zod.string().nullable().optional().describe("Execution comment. Pass null to clear the existing comment."),
15
+ actualTime: zod.string().regex(ACTUAL_TIME_REGEX).nullable().optional().describe(
16
+ "Time already spent on the execution. Format: 'HH:mm:ss' e.g. '02:30:00' (2 hours 30 minutes 0 seconds). Pass null to clear."
17
+ ),
18
+ executionAssignee: zod.string().nullable().optional().describe(
19
+ "Jira account ID of the assignee (not a display name). Pass null to unassign."
20
+ ),
21
+ environmentId: zod.string().optional().describe(
22
+ "Environment name (e.g. 'Production', 'Staging', 'Google Chrome', 'Firefox'). Auto-resolved to its numeric ID; an unresolved name is dropped and a warning is returned."
23
+ ),
24
+ executionPlannedDate: zod.string().regex(DATE_REGEX).nullable().optional().describe(
25
+ "Planned execution date. Format: 'dd/MMM/yyyy' e.g. '15/Oct/2025'. Month must be capitalised (Oct, not oct or OCT). Pass null to clear."
26
+ ),
27
+ buildId: zod.string().nullable().optional().describe(
28
+ "Build name (e.g. 'Build 2.0', '1.0.0'). Auto-resolved to its numeric ID; an unresolved name is dropped and a warning is returned. Pass null to clear."
29
+ )
30
+ });
31
+ const UpdateTestCaseExecutionResponse = zod.object({
32
+ testCycleKey: zod.string().describe("Test cycle key of the updated execution."),
33
+ testCaseKey: zod.string().describe("Test case key of the updated execution."),
34
+ updated: zod.literal(true).describe(
35
+ "True when the server returned 204 No Content, confirming the execution was updated successfully."
36
+ )
37
+ });
38
+ export {
39
+ UpdateTestCaseExecutionBody,
40
+ UpdateTestCaseExecutionResponse
41
+ };
@@ -0,0 +1,41 @@
1
+ import * as zod from "zod";
2
+ const UpdateTestStepExecutionBody = zod.object({
3
+ testCycleKey: zod.string().describe(
4
+ "Test cycle key in the format '{PROJECT_KEY}-TR-{number}', e.g. 'SCRUM-TR-101'. Used directly as the API path parameter."
5
+ ),
6
+ testCaseKey: zod.string().describe(
7
+ "Test case key in the format '{PROJECT_KEY}-TC-{number}', e.g. 'SCRUM-TC-145'."
8
+ ),
9
+ testStepSeqNo: zod.number().int().positive("testStepSeqNo must be a positive integer.").describe(
10
+ "sequence number of the step to update (e.g. 2 = the second step)."
11
+ ),
12
+ // Updatable fields — supply at least one.
13
+ executionResultId: zod.string().optional().describe(
14
+ "Execution result name, e.g. 'Pass', 'Fail', 'Blocked', 'In Progress', 'Not Executed'. Project-specific (custom results allowed); resolved case-insensitively to a numeric executionResultId."
15
+ ),
16
+ comment: zod.string().nullable().optional().describe(
17
+ "Step execution comment. Pass null to clear the existing comment."
18
+ ),
19
+ actualResult: zod.string().nullable().optional().describe(
20
+ "Actual result for this test step. Set to null to clear the existing value."
21
+ )
22
+ });
23
+ const UpdateTestStepExecutionResponse = zod.object({
24
+ testCycleKey: zod.string().describe(
25
+ "Key of the test cycle containing the updated step execution (e.g. 'SCRUM-TR-101')."
26
+ ),
27
+ testCaseKey: zod.string().describe(
28
+ "Key of the test case whose step execution was updated (e.g. 'SCRUM-TC-145')."
29
+ ),
30
+ testStepSeqNo: zod.number().describe("sequence number of the test step whose execution was updated."),
31
+ executionResultName: zod.string().optional().describe(
32
+ "Name of the execution result applied to the step (e.g. 'Pass', 'Fail'). Present only when the server returns it."
33
+ ),
34
+ updated: zod.literal(true).describe(
35
+ "True when the server confirms the update (HTTP 200 OK) and the test step execution is successfully updated."
36
+ )
37
+ });
38
+ export {
39
+ UpdateTestStepExecutionBody,
40
+ UpdateTestStepExecutionResponse
41
+ };
@@ -1,5 +1,5 @@
1
1
  import { Tool } from "../../../common/tools.js";
2
- import { TOOL_NAMES, TOOLSETS, RESPONSE_FIELDS, PAGINATION, ENDPOINTS } from "../../config/constants.js";
2
+ import { TOOL_NAMES, TOOLSETS, RESPONSE_FIELDS, ENDPOINTS } from "../../config/constants.js";
3
3
  import { GetProjectsResponse, GetProjectsBody } from "../../schema/project.schema.js";
4
4
  class GetProjects extends Tool {
5
5
  specification = {
@@ -90,8 +90,8 @@ class GetProjects extends Tool {
90
90
  handle = async (args) => {
91
91
  const input = GetProjectsBody.parse(args);
92
92
  const body = {
93
- [RESPONSE_FIELDS.START_AT]: input.startAt ?? PAGINATION.DEFAULT_START_AT,
94
- [RESPONSE_FIELDS.MAX_RESULTS]: input.maxResults ?? PAGINATION.DEFAULT_MAX_RESULTS_PROJECTS,
93
+ [RESPONSE_FIELDS.START_AT]: input.startAt,
94
+ [RESPONSE_FIELDS.MAX_RESULTS]: input.maxResults,
95
95
  ...input.projectId !== void 0 && { projectId: input.projectId },
96
96
  ...input.search && { search: input.search },
97
97
  ...input.qmetryEnabled !== void 0 && {
@@ -52,7 +52,7 @@ class SetProjectContext extends Tool {
52
52
  [RESPONSE_FIELDS.MAX_RESULTS]: PROJECT_SEARCH_MAX_RESULTS,
53
53
  search: projectKey
54
54
  };
55
- const response = await apiClient.post(ENDPOINTS.PROJECTS, body);
55
+ const response = await apiClient.skipAnalytics().post(ENDPOINTS.PROJECTS, body);
56
56
  const parsed = GetProjectsResponse.parse(response);
57
57
  if (parsed.data.length === 0) {
58
58
  throw new ToolError(ERRORS.PROJECT_NOT_FOUND(projectKey));
@@ -51,13 +51,10 @@ class GetAutomationHistory extends Tool {
51
51
  handle = async (rawArgs) => {
52
52
  const args = GetAutomationHistoryBody.parse(rawArgs);
53
53
  const apiClient = this.client.getApiClient();
54
- const response = await apiClient.getAutomation(
55
- ENDPOINTS.AUTOMATION_HISTORY,
56
- {
57
- startAt: args.startAt,
58
- maxResults: args.maxResults
59
- }
60
- );
54
+ const response = await apiClient.skipAnalytics().getAutomation(ENDPOINTS.AUTOMATION_HISTORY, {
55
+ startAt: args.startAt,
56
+ maxResults: args.maxResults
57
+ });
61
58
  const result = GetAutomationHistoryResponse.parse(response);
62
59
  return {
63
60
  structuredContent: result,
@@ -1,7 +1,7 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import { extname } from "node:path";
3
3
  import { Tool, ToolError } from "../../../common/tools.js";
4
- import { TOOL_NAMES, TOOLSETS, AUTOMATION_RESULT_DIRS, AUTOMATION_LIMITS, ENDPOINTS } from "../../config/constants.js";
4
+ import { TOOL_NAMES, TOOLSETS, AUTOMATION_RESULT_DIRS, AUTOMATION_LIMITS, ENDPOINTS, CLIENT_CONFIG, IMPORT_BODY_FIELDS } from "../../config/constants.js";
5
5
  import { UploadAutomationResultResponse, UploadAutomationResultBody } from "../../schema/automation.schema.js";
6
6
  const SUPPORTED_EXTENSIONS = /* @__PURE__ */ new Set([".xml", ".json", ".zip"]);
7
7
  class UploadAutomationResult extends Tool {
@@ -111,7 +111,9 @@ class UploadAutomationResult extends Tool {
111
111
  const apiClient = this.client.getApiClient();
112
112
  const importBody = {
113
113
  format,
114
- isZip: isZip ?? false,
114
+ isZip,
115
+ [IMPORT_BODY_FIELDS.REQUEST_SOURCE]: CLIENT_CONFIG.SOURCE_VALUE,
116
+ [IMPORT_BODY_FIELDS.ALLOW_TRACKING]: true,
115
117
  ...rest,
116
118
  ...fields ? { fields } : {}
117
119
  };