@smartbear/mcp 0.26.0 → 0.27.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.
- package/README.md +10 -2
- package/dist/package.json.js +1 -1
- package/dist/qmetry/client/api/client-api.js +13 -1
- package/dist/qmetry/client/auto-resolve.js +23 -1
- package/dist/qmetry/client/handlers.js +10 -2
- package/dist/qmetry/client/issues.js +113 -1
- package/dist/qmetry/client/testcase.js +82 -1
- package/dist/qmetry/client/testsuite.js +20 -8
- package/dist/qmetry/client/tools/index.js +5 -2
- package/dist/qmetry/client/tools/issue-tools.js +163 -1
- package/dist/qmetry/client/tools/testcase-tools.js +81 -7
- package/dist/qmetry/client/tools/testsuite-tools.js +291 -26
- package/dist/qmetry/client/tools/udf-tools.js +294 -0
- package/dist/qmetry/client/udf.js +376 -0
- package/dist/qmetry/client.js +30 -3
- package/dist/qmetry/config/constants.js +63 -2
- package/dist/qmetry/config/rest-endpoints.js +7 -1
- package/dist/qmetry/types/common.js +85 -47
- package/dist/qmetry/types/issues.js +5 -0
- package/dist/qmetry/types/udf.js +77 -0
- package/dist/swagger/client/api.js +421 -8
- package/dist/swagger/client/configuration.js +9 -0
- package/dist/swagger/client/functional-testing-api.js +38 -2
- package/dist/swagger/client/functional-testing-tools.js +18 -0
- package/dist/swagger/client/functional-testing-types.js +11 -0
- package/dist/swagger/client/portal-types.js +35 -3
- package/dist/swagger/client/portal-utils.js +50 -0
- package/dist/swagger/client/registry-types.js +8 -0
- package/dist/swagger/client/tools.js +25 -4
- package/dist/swagger/client/utils.js +37 -0
- package/dist/swagger/client.js +37 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QMetryToolsHandlers } from "../../config/constants.js";
|
|
2
|
-
import { CreateIssueArgsSchema, UpdateIssueArgsSchema, IssuesListArgsSchema, LinkedIssuesByTestCaseRunArgsSchema, LinkIssuesToTestcaseRunArgsSchema, IssuesLinkedToTestCaseArgsSchema } from "../../types/common.js";
|
|
2
|
+
import { CreateIssueArgsSchema, UpdateIssueArgsSchema, IssuesListArgsSchema, LinkedIssuesByTestCaseRunArgsSchema, LinkIssuesToTestcaseRunArgsSchema, IssueExecutionsArgsSchema, IssuesLinkedToTestCaseArgsSchema } from "../../types/common.js";
|
|
3
3
|
const ISSUE_TOOLS = [
|
|
4
4
|
{
|
|
5
5
|
title: "Create Defect or Issue",
|
|
@@ -441,6 +441,168 @@ const ISSUE_TOOLS = [
|
|
|
441
441
|
readOnly: false,
|
|
442
442
|
idempotent: false
|
|
443
443
|
},
|
|
444
|
+
{
|
|
445
|
+
title: "Fetch Issue Executions",
|
|
446
|
+
toolset: "Issues",
|
|
447
|
+
summary: "Get test case executions linked to a QMetry-native (non-Jira) defect/issue. ALWAYS present results as a unified table: Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | <UDF Label columns…>. NEVER show a separate type+value UDF breakdown — always combine identification fields and UDF values in one table per execution row.",
|
|
448
|
+
handler: QMetryToolsHandlers.FETCH_ISSUE_EXECUTIONS,
|
|
449
|
+
inputSchema: IssueExecutionsArgsSchema,
|
|
450
|
+
purpose: "Retrieve all test case execution runs that are linked to a specific QMetry-native defect or issue. This tool is for local QMetry issues only (not Jira-integrated projects). Returns execution details including test case name, run status, platform, release/cycle, and UDF fields. The issue execution API (/rest/execution/getExecutionsForIssue) already returns Test Run UDF saved values in each row's udfjson field. This tool parses that udfjson and enriches it with Test Run UDF metadata so all configured UDF fields are included, even when a value is empty. Do NOT call 'Fetch Test Run UDF Values' after this tool for issue execution UDFs; that generic UDF tool uses the test-suite-run execution API, which is not the correct issue execution source. To get linkedAssetId, call Fetch Defects or Issues tool and use data[<index>].id from the response. IMPORTANT: Every execution record always contains key identification fields — Test Suite Key (tsEntityKey), Test Suite Name (tsName), Release (releaseName), Cycle (cycleName), Platform (platformName), Executed Version (executedVersion), and Test Run UDF values (testRunUdfs). These MUST always be shown in the response so users can identify which test suite run each execution belongs to.",
|
|
451
|
+
useCases: [
|
|
452
|
+
"Get all test executions linked to a specific defect",
|
|
453
|
+
"Audit which test cases were run against a given issue",
|
|
454
|
+
"Filter executions by run status (failed, passed, etc.) for an issue",
|
|
455
|
+
"Filter executions by platform/environment for an issue",
|
|
456
|
+
"Filter executions by tester/executor for an issue",
|
|
457
|
+
"Show archived and active test suite executions for an issue",
|
|
458
|
+
"View UDF (custom field) values on executions linked to an issue",
|
|
459
|
+
"Track test coverage and execution progress for a defect"
|
|
460
|
+
],
|
|
461
|
+
examples: [
|
|
462
|
+
{
|
|
463
|
+
description: "Get all executions linked to issue ID 9598240",
|
|
464
|
+
parameters: {
|
|
465
|
+
linkedAssetId: 9598240
|
|
466
|
+
},
|
|
467
|
+
expectedOutput: "Present as ONE unified table — never as a separate type+value UDF breakdown. Example:\n| Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | Tested By | Environments UDF | Execution Type |\n| MAC-TS-42 | Regression Suite | R1 | Sprint1 | Chrome | 1 | Failed | varis | chrome, edge, safari | Functional |\n| MAC-TS-43 | Login Suite | R1 | Sprint1 | Firefox | 2 | Blocked | john | firefox | Regression |\nColumns in order: Test Suite Key (tsEntityKey) | Test Suite Name (tsName) | Release (releaseName) | Cycle (cycleName) | Platform (platformName) | Executed Version (executedVersion) | Execution Status (runStatusName) | then one column per UDF label. Use the UDF 'label' as column header. Show null UDF values as '-'."
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
description: "Get executions with pagination (page 1, 20 records)",
|
|
471
|
+
parameters: {
|
|
472
|
+
linkedAssetId: 9598240,
|
|
473
|
+
page: 1,
|
|
474
|
+
start: 0,
|
|
475
|
+
limit: 20
|
|
476
|
+
},
|
|
477
|
+
expectedOutput: "First 20 executions linked to the issue"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
description: "Filter executions by run status (failed or passed)",
|
|
481
|
+
parameters: {
|
|
482
|
+
linkedAssetId: 9509016,
|
|
483
|
+
filter: '[{"type":"list","field":"runStatusName","value":["failed","passed"]}]',
|
|
484
|
+
page: 1,
|
|
485
|
+
start: 0,
|
|
486
|
+
limit: 20
|
|
487
|
+
},
|
|
488
|
+
expectedOutput: "Executions with failed or passed status for the issue"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
description: "Filter executions by test case name",
|
|
492
|
+
parameters: {
|
|
493
|
+
linkedAssetId: 9509016,
|
|
494
|
+
filter: '[{"type":"string","value":"login","field":"tcName"}]',
|
|
495
|
+
page: 1,
|
|
496
|
+
start: 0,
|
|
497
|
+
limit: 20
|
|
498
|
+
},
|
|
499
|
+
expectedOutput: "Executions where test case name contains 'login'"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
description: "Filter by platform, status, and tester",
|
|
503
|
+
parameters: {
|
|
504
|
+
linkedAssetId: 9509016,
|
|
505
|
+
filter: '[{"type":"list","field":"runStatusName","value":["failed"]},{"type":"list","field":"platformID","value":[100145]},{"type":"list","field":"executionCreatedByLoginAlias","value":["Varis Khan"]}]',
|
|
506
|
+
page: 1,
|
|
507
|
+
start: 0,
|
|
508
|
+
limit: 20
|
|
509
|
+
},
|
|
510
|
+
expectedOutput: "Failed executions on platform 100145 created by Varis Khan"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
description: "Filter by status and include archived test suite executions",
|
|
514
|
+
parameters: {
|
|
515
|
+
linkedAssetId: 9509016,
|
|
516
|
+
filter: '[{"type":"list","field":"runStatusName","value":["failed","passed"]},{"value":[1,0],"type":"list","field":"isTestSuiteArchived"}]',
|
|
517
|
+
page: 1,
|
|
518
|
+
start: 0,
|
|
519
|
+
limit: 20
|
|
520
|
+
},
|
|
521
|
+
expectedOutput: "Executions with failed/passed status including archived test suites"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
description: "Filter by execution version and linkage level",
|
|
525
|
+
parameters: {
|
|
526
|
+
linkedAssetId: 9509016,
|
|
527
|
+
filter: '[{"type":"string","value":"1","field":"executedVersion"},{"type":"string","value":"Test Case","field":"linkageLevel"}]',
|
|
528
|
+
page: 1,
|
|
529
|
+
start: 0,
|
|
530
|
+
limit: 20
|
|
531
|
+
},
|
|
532
|
+
expectedOutput: "Executions at Test Case linkage level for version 1"
|
|
533
|
+
}
|
|
534
|
+
],
|
|
535
|
+
hints: [
|
|
536
|
+
"=== MANDATORY RESPONSE FORMAT — READ THIS BEFORE RENDERING ANY OUTPUT ===",
|
|
537
|
+
"",
|
|
538
|
+
"PIVOT RULE — CRITICAL:",
|
|
539
|
+
"The 'testRunUdfs' field on each execution is an array of { name, label, fieldID, fieldType, value }.",
|
|
540
|
+
"You MUST pivot this array into TABLE COLUMNS — do NOT render it as rows.",
|
|
541
|
+
" → Each testRunUdfs[i].label = a column header in the unified table",
|
|
542
|
+
" → Each testRunUdfs[i].value = the cell value for that execution's row",
|
|
543
|
+
" → testRunUdfs[i].fieldType = INTERNAL METADATA — NEVER show this as a column",
|
|
544
|
+
" → testRunUdfs[i].fieldID = INTERNAL METADATA — NEVER show this as a column",
|
|
545
|
+
"",
|
|
546
|
+
"FORBIDDEN PATTERNS — NEVER do any of these:",
|
|
547
|
+
" ❌ Do NOT render a separate sub-table (UDF Label | Type | Value) per execution",
|
|
548
|
+
" ❌ Do NOT show 'Type' or 'fieldType' as a visible column",
|
|
549
|
+
" ❌ Do NOT group output by tcRunID with individual breakdowns beneath each",
|
|
550
|
+
" ❌ Do NOT show raw UDF field keys (e.g. 'TRString', '8260LUP') as headers — use 'label'",
|
|
551
|
+
"",
|
|
552
|
+
"REQUIRED OUTPUT — ONE unified table, all executions as rows:",
|
|
553
|
+
"| Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | <UDF Label 1> | <UDF Label 2> | ... |",
|
|
554
|
+
"|----------------|-----------------|---------|-------|----------|------------------|------------------|---------------|---------------|-----|",
|
|
555
|
+
"| MAC-TS-42 | Login Suite | R1 | S1 | Chrome | v1 | Failed | varis | chrome, edge | ... |",
|
|
556
|
+
"",
|
|
557
|
+
"MANDATORY COLUMNS (always first, in this order):",
|
|
558
|
+
" 1. Test Suite Key → tsEntityKey (e.g. 'MAC-TS-42')",
|
|
559
|
+
" 2. Test Suite Name → tsName (test suite display name)",
|
|
560
|
+
" 3. Release → releaseName",
|
|
561
|
+
" 4. Cycle → cycleName",
|
|
562
|
+
" 5. Platform → platformName",
|
|
563
|
+
" 6. Executed Version → executedVersion",
|
|
564
|
+
" 7. Execution Status → runStatusName",
|
|
565
|
+
" 8. Tested By → executionCreatedByLoginAlias/testedBy when present",
|
|
566
|
+
" 9+. One column per UDF field — use testRunUdfs[i].label as header, testRunUdfs[i].value as cell.",
|
|
567
|
+
"",
|
|
568
|
+
"Null UDF values → show as '-'. If hasTcRunUdf is false, show columns 1-8 only.",
|
|
569
|
+
"ISSUE EXECUTION UDF SOURCE — CRITICAL:",
|
|
570
|
+
"Do NOT call 'Fetch Test Run UDF Values' for issue execution UDFs.",
|
|
571
|
+
"Do NOT create or use another issue-specific UDF fetch tool.",
|
|
572
|
+
"Use this tool's response directly: it calls /rest/execution/getExecutionsForIssue for execution rows, parses each row's udfjson for saved UDF values, and uses Test Run UDF metadata to include all configured UDF labels with null/empty values.",
|
|
573
|
+
"=== END MANDATORY RESPONSE FORMAT ===",
|
|
574
|
+
"",
|
|
575
|
+
"CRITICAL: linkedAssetId is REQUIRED - this is the numeric defect ID from QMetry (not entity key like VKT-IS-5)",
|
|
576
|
+
"HOW TO GET linkedAssetId: Call Fetch Defects or Issues tool → use data[<index>].id from the response",
|
|
577
|
+
"AUTO-RESOLVE: If user provides an issue entity key (e.g. VKT-IS-5, MAC-IS-10), first call Fetch Defects or Issues with that entity key as filter, extract data[<index>].id, then use it as linkedAssetId",
|
|
578
|
+
`AUTO-RESOLVE FILTER EXAMPLE: to resolve VKT-IS-5 → use filter '[{"type":"string","value":"VKT-IS-5","field":"entityKeyId"}]' in Fetch Defects or Issues tool`,
|
|
579
|
+
"This tool supports QMetry-native issues only — do NOT use for Jira-integrated projects",
|
|
580
|
+
"API SOURCE: Execution rows and saved UDF values come from /rest/execution/getExecutionsForIssue. The udfjson field contains saved Test Run UDF values, e.g. Tested_By, execution_type, Country_mcp_udf, environments_udf.",
|
|
581
|
+
"METADATA SOURCE: This tool also calls Test Run UDF metadata once to get all available labels, fieldIDs, field types, and empty fields. Merge metadata fields with udfjson values by UDF name.",
|
|
582
|
+
"RESPONSE FIELDS: hasTcRunUdf=true means executions have UDF data; each execution includes a 'testRunUdfs' array with ALL project-defined UDF fields",
|
|
583
|
+
"ALL UDF FIELDS: ALL project-defined Test Run UDF fields are returned for every execution — including fields not yet set (value: null)",
|
|
584
|
+
"Each element in testRunUdfs: { name, label, fieldID, fieldType, value } — use fieldID when calling 'Bulk Update Test Run UDFs'",
|
|
585
|
+
'EXAMPLE testRunUdfs: [{ "name": "TRString", "label": "TR String", "fieldID": 229241, "fieldType": "STRING", "value": "test" }, { "name": "dateField", "label": "Date", "fieldID": 229255, "fieldType": "DATETIMEPICKER", "value": null }]',
|
|
586
|
+
"FILTER FIELDS:",
|
|
587
|
+
" - tcName (string): filter by test case name substring",
|
|
588
|
+
" - linkageLevel (string): 'Test Case' or 'Test Step'",
|
|
589
|
+
" - executedVersion (string): version number as string e.g. '1'",
|
|
590
|
+
' - runStatusName (list): e.g. ["failed","passed","in progress"]',
|
|
591
|
+
" - platformID (list): numeric platform IDs e.g. [100145]. Get from FETCH_PLATFORMS tool",
|
|
592
|
+
' - executionCreatedByLoginAlias (list): usernames/login aliases e.g. ["john.doe"]',
|
|
593
|
+
" - isTestSuiteArchived (list): [1] active only, [0] archived only, [1,0] both",
|
|
594
|
+
`FILTER FORMAT: JSON string array — '[{"type":"list","field":"runStatusName","value":["failed"]}]'`,
|
|
595
|
+
"Multiple filter conditions are combined with AND logic",
|
|
596
|
+
"Use pagination (page, start, limit) for large result sets",
|
|
597
|
+
"Get platform IDs using the FETCH_PLATFORMS tool before filtering by platformID",
|
|
598
|
+
"Execution status names are case-sensitive — use lowercase: 'failed', 'passed', 'in progress', 'blocked', 'not run'",
|
|
599
|
+
"hasTcRunUdf: false → No Test Run UDFs configured; testRunUdfs will not appear; a 'testRunUdfNote' field explains this."
|
|
600
|
+
],
|
|
601
|
+
outputDescription: "JSON object with 'data' array of execution records, 'hasTcRunUdf' boolean flag, and 'total' count. Each execution record ALWAYS contains these mandatory identification fields: 'tsEntityKey' (Test Suite Key, e.g. 'MAC-TS-42'), 'tsName' (Test Suite Name), 'releaseName' (Release), 'cycleName' (Cycle), 'platformName' (Platform/environment), 'executedVersion' (Executed Version of the test case), 'runStatusName' (Execution Status label), 'tcRunID' (numeric Test Run ID), 'tcName' (Test Case Name), 'tcEntityKey' (Test Case Key), and 'testRunUdfs' (array of objects each with name, label, fieldID, fieldType, value — use 'label' for display headers, null if not set). ALL project-defined UDF fields are always included, even those with no value. When hasTcRunUdf is false, a 'testRunUdfNote' field provides a professional explanation instead.",
|
|
602
|
+
readOnly: true,
|
|
603
|
+
idempotent: true,
|
|
604
|
+
openWorld: false
|
|
605
|
+
},
|
|
444
606
|
{
|
|
445
607
|
title: "Fetch Issues Linked to Test Case",
|
|
446
608
|
toolset: "Issues",
|
|
@@ -944,10 +944,10 @@ const TESTCASE_TOOLS = [
|
|
|
944
944
|
{
|
|
945
945
|
title: "Fetch Test Case Executions",
|
|
946
946
|
toolset: "Test Cases",
|
|
947
|
-
summary: "Get execution records for a specific test case by numeric ID",
|
|
947
|
+
summary: "Get execution records for a specific test case by numeric ID, including Test Run UDF values. ALWAYS present results as a unified table: Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | <UDF Label columns…>. NEVER show a separate type+value UDF breakdown — always combine identification fields and UDF values in one table per execution row.",
|
|
948
948
|
handler: QMetryToolsHandlers.FETCH_TEST_CASE_EXECUTIONS,
|
|
949
949
|
inputSchema: TestCaseExecutionsArgsSchema,
|
|
950
|
-
purpose: "Retrieve execution history and results for a specific test case. This tool provides detailed execution information including test suite names, platforms, execution status, executed by, project, release, cycle, execution date, and test case versions.",
|
|
950
|
+
purpose: "Retrieve execution history and results for a specific test case. This tool provides detailed execution information including test suite names, platforms, execution status, executed by, project, release, cycle, execution date, and test case versions. IMPORTANT: Every execution record always contains key identification fields — Test Suite Key (tsEntityKey), Test Suite Name (testsuiteName), Release (releaseName), Cycle (cycleName), Platform (platform), Executed Version (executedVersion), and Test Run UDF values (testRunUdfs). These MUST always be shown in the response so users can identify which test suite run each execution belongs to.",
|
|
951
951
|
useCases: [
|
|
952
952
|
"Get execution history for a specific test case",
|
|
953
953
|
"Retrieve test case execution results for reporting",
|
|
@@ -958,13 +958,16 @@ const TESTCASE_TOOLS = [
|
|
|
958
958
|
"Get execution details for specific test case versions",
|
|
959
959
|
"Audit test execution history for compliance",
|
|
960
960
|
"Analyze test case execution performance across different environments",
|
|
961
|
-
"Track test execution by specific users or teams"
|
|
961
|
+
"Track test execution by specific users or teams",
|
|
962
|
+
"Fetch Test Run UDF values for a specific test case's execution records",
|
|
963
|
+
"Inspect custom metadata captured during test execution via Test Run UDFs",
|
|
964
|
+
"Check whether the project has Test Run UDFs configured (hasTcRunUdf flag)"
|
|
962
965
|
],
|
|
963
966
|
examples: [
|
|
964
967
|
{
|
|
965
968
|
description: "Get all executions for test case ID 1223922",
|
|
966
969
|
parameters: { tcid: 1223922 },
|
|
967
|
-
expectedOutput: "
|
|
970
|
+
expectedOutput: "Present as ONE unified table — never as a separate type+value UDF breakdown. Example:\n| Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | Tested By | Environments UDF | Execution Type |\n| MAC-TS-42 | Regression Suite | R1 | Sprint1| Chrome | v1 | Passed | varis | chrome, edge, safari | Functional |\n| MAC-TS-42 | Regression Suite | R1 | Sprint1| Firefox | v2 | Failed | john | firefox | Regression |\nColumns in order: Test Suite Key (tsEntityKey) | Test Suite Name (testsuiteName) | Release (releaseName) | Cycle (cycleName) | Platform (platform) | Executed Version (executedVersion) | Execution Status | then one column per UDF label. Use the UDF 'label' as column header. Show null UDF values as '-'."
|
|
968
971
|
},
|
|
969
972
|
{
|
|
970
973
|
description: "Get executions for specific test case version",
|
|
@@ -1010,9 +1013,59 @@ const TESTCASE_TOOLS = [
|
|
|
1010
1013
|
filter: '[{"value":["john.doe"],"type":"list","field":"executedBy"}]'
|
|
1011
1014
|
},
|
|
1012
1015
|
expectedOutput: "Execution records executed by specific user"
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
description: "Fetch Test Run UDF values for all executions of test case ID 41571999",
|
|
1019
|
+
parameters: { tcid: 41571999 },
|
|
1020
|
+
expectedOutput: "Present as ONE unified table combining identification fields and UDF values — never a separate type+value breakdown. Example:\n| Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | Tested By | Environments UDF | Execution Type | Country |\n| MAC-TS-42 | Login Suite | R1 | Sprint1 | Chrome | v1 | Passed | varis | chrome, edge, safari | Functional | India > i3 |\nUDF column headers use the UDF 'label' (not raw field key). Null values shown as '-'."
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
description: "Check if project has Test Run UDFs — response includes hasTcRunUdf flag",
|
|
1024
|
+
parameters: { tcid: 1223922 },
|
|
1025
|
+
expectedOutput: "Response contains hasTcRunUdf: true (UDFs present, testRunUdfs populated) or hasTcRunUdf: false (no UDFs configured, testRunUdfNote explains this)"
|
|
1013
1026
|
}
|
|
1014
1027
|
],
|
|
1015
1028
|
hints: [
|
|
1029
|
+
"=== MANDATORY RESPONSE FORMAT — READ THIS BEFORE RENDERING ANY OUTPUT ===",
|
|
1030
|
+
"",
|
|
1031
|
+
"PIVOT RULE — CRITICAL:",
|
|
1032
|
+
"The 'testRunUdfs' field on each execution is an array of { name, label, fieldID, fieldType, value }.",
|
|
1033
|
+
"You MUST pivot this array into TABLE COLUMNS — do NOT render it as rows.",
|
|
1034
|
+
" → Each testRunUdfs[i].label = a column header in the unified table",
|
|
1035
|
+
" → Each testRunUdfs[i].value = the cell value for that execution's row",
|
|
1036
|
+
" → testRunUdfs[i].fieldType = INTERNAL METADATA — NEVER show this as a column",
|
|
1037
|
+
" → testRunUdfs[i].fieldID = INTERNAL METADATA — NEVER show this as a column",
|
|
1038
|
+
"",
|
|
1039
|
+
"FORBIDDEN PATTERNS — NEVER do any of these:",
|
|
1040
|
+
" ❌ Do NOT render a separate sub-table (UDF Label | Type | Value) per execution",
|
|
1041
|
+
" ❌ Do NOT show 'Type' or 'fieldType' as a visible column",
|
|
1042
|
+
" ❌ Do NOT group output by tcRunID with individual breakdowns beneath each",
|
|
1043
|
+
" ❌ Do NOT show raw UDF field keys (e.g. 'TRString', '8260LUP') as headers — use 'label'",
|
|
1044
|
+
"",
|
|
1045
|
+
"REQUIRED OUTPUT — ONE unified table, all executions as rows:",
|
|
1046
|
+
"| Test Suite Key | Test Suite Name | Release | Cycle | Platform | Executed Version | Execution Status | <UDF Label 1> | <UDF Label 2> | ... |",
|
|
1047
|
+
"|----------------|-----------------|---------|-------|----------|------------------|------------------|---------------|---------------|-----|",
|
|
1048
|
+
"| MAC-TS-42 | Login Suite | R1 | S1 | Chrome | v1 | Passed | varis | chrome, edge | ... |",
|
|
1049
|
+
"",
|
|
1050
|
+
"MANDATORY COLUMNS (always first, in this order):",
|
|
1051
|
+
" 1. Test Suite Key → tsEntityKey (e.g. 'MAC-TS-42')",
|
|
1052
|
+
" 2. Test Suite Name → testsuiteName (test suite display name)",
|
|
1053
|
+
" 3. Release → releaseName",
|
|
1054
|
+
" 4. Cycle → cycleName",
|
|
1055
|
+
" 5. Platform → platform",
|
|
1056
|
+
" 6. Executed Version → executedVersion",
|
|
1057
|
+
" 7. Execution Status → executionStatus",
|
|
1058
|
+
" 8. Tested By → testedBy/executedBy when present",
|
|
1059
|
+
" 9+. One column per UDF field — use testRunUdfs[i].label as header, testRunUdfs[i].value as cell.",
|
|
1060
|
+
"",
|
|
1061
|
+
"Null UDF values → show as '-'. If hasTcRunUdf is false, show columns 1-8 only.",
|
|
1062
|
+
"UDF DATA SOURCE — THIS TOOL IS SELF-CONTAINED:",
|
|
1063
|
+
"This tool automatically calls Test Run UDF metadata once (project-wide) and parses the udfjson field from each execution row.",
|
|
1064
|
+
"The 'testRunUdfs' array in every execution record already contains ALL configured UDF fields — including fields with no value (null).",
|
|
1065
|
+
"DO NOT call 'Fetch Test Run UDF Values' after this tool for test case executions — that tool uses GET_TESTCASE_RUNS_BY_TESTSUITE_RUN which is for test suite runs, not test case executions.",
|
|
1066
|
+
"NEVER chain 'Fetch Test Run UDF Values' when the user asks for UDF values of test case executions — use testRunUdfs from THIS response directly.",
|
|
1067
|
+
"=== END MANDATORY RESPONSE FORMAT ===",
|
|
1068
|
+
"",
|
|
1016
1069
|
"This API requires a numeric tcid parameter, not entity key",
|
|
1017
1070
|
"If user provides entityKey (e.g., MAC-TC-1684), first call FETCH_TEST_CASES with filter on entityKeyId to resolve the tcid",
|
|
1018
1071
|
"After resolving entityKey → tcid, call this tool with the resolved numeric tcid",
|
|
@@ -1035,7 +1088,7 @@ const TESTCASE_TOOLS = [
|
|
|
1035
1088
|
"ALWAYS get tcRunID from executions and use THAT as entityId!",
|
|
1036
1089
|
"",
|
|
1037
1090
|
"EXAMPLE RESPONSE STRUCTURE FROM THIS TOOL:",
|
|
1038
|
-
'{ "data": [{ "tcRunID": 58312120, "testSuiteName": "Suite 1", "executionStatus": "PASS" }] }',
|
|
1091
|
+
'{ "data": [{ "tcRunID": 58312120, "testSuiteName": "Suite 1", "executionStatus": "PASS", "testRunUdfs": [...] }] }',
|
|
1039
1092
|
"→ Use tcRunID (58312120) as entityId for linked issues API",
|
|
1040
1093
|
"",
|
|
1041
1094
|
"FILTER CAPABILITIES: Support extensive filtering by test suite, platform, status, user, release, cycle, dates, and archive status",
|
|
@@ -1048,9 +1101,30 @@ const TESTCASE_TOOLS = [
|
|
|
1048
1101
|
"Get platform IDs from FETCH_PLATFORMS tool and release/cycle IDs from FETCH_RELEASES_AND_CYCLES tool",
|
|
1049
1102
|
"This tool is essential for test execution reporting, trend analysis, and compliance auditing",
|
|
1050
1103
|
"Execution data includes timestamps, user information, environment details, and test results",
|
|
1051
|
-
"Use scope parameter to define retrieval context (project, folder, release, cycle)"
|
|
1104
|
+
"Use scope parameter to define retrieval context (project, folder, release, cycle)",
|
|
1105
|
+
"",
|
|
1106
|
+
"TEST RUN UDF SUPPORT:",
|
|
1107
|
+
"This tool automatically fetches UDF metadata (project-wide, one call for all executions) and enriches each execution record.",
|
|
1108
|
+
"ALL project-defined Test Run UDF fields are returned for every execution — including fields with no value (value: null).",
|
|
1109
|
+
"HTML is stripped from rich text (LARGETEXT) UDF field values for clean output.",
|
|
1110
|
+
"Each execution's 'testRunUdfs' is an array of objects:",
|
|
1111
|
+
" testRunUdfs: [",
|
|
1112
|
+
' { "name": "8260LUP", "label": "Lookup Field", "fieldID": 228563, "fieldType": "LOOKUPLIST", "value": "l1" },',
|
|
1113
|
+
' { "name": "TRString", "label": "TR String", "fieldID": 229241, "fieldType": "STRING", "value": "dsf" },',
|
|
1114
|
+
' { "name": "notes_run", "label": "Notes Run", "fieldID": 229242, "fieldType": "LARGETEXT", "value": null },',
|
|
1115
|
+
' { "name": "cascade_vK", "label": "Cascade VK", "fieldID": 229426, "fieldType": "CASCADINGLIST", "value": { "child": "qq", "parent": "vkc" } }',
|
|
1116
|
+
" ]",
|
|
1117
|
+
"Use 'fieldID' from testRunUdfs entries when calling 'Bulk Update Test Run UDFs'.",
|
|
1118
|
+
"",
|
|
1119
|
+
"hasTcRunUdf FLAG — IMPORTANT:",
|
|
1120
|
+
"The response contains a 'hasTcRunUdf' boolean flag at the top level.",
|
|
1121
|
+
"hasTcRunUdf: true → Project has Test Run UDFs configured; each execution record includes 'testRunUdfs' array with all fields.",
|
|
1122
|
+
"hasTcRunUdf: false → Project has NO Test Run UDFs configured.",
|
|
1123
|
+
" When hasTcRunUdf is false, the response includes a 'testRunUdfNote' field with a professional explanation.",
|
|
1124
|
+
" Inform the user: 'No Test Run UDFs are configured for this project. Contact a project administrator to set up Test Run UDF fields.'",
|
|
1125
|
+
"NEVER attempt to read testRunUdfs from records when hasTcRunUdf is false — the field will not be present."
|
|
1052
1126
|
],
|
|
1053
|
-
outputDescription: "JSON object with executions array
|
|
1127
|
+
outputDescription: "JSON object with executions array. Each execution record ALWAYS contains these mandatory identification fields: 'tsEntityKey' (Test Suite Key, e.g. 'MAC-TS-42'), 'testsuiteName' (Test Suite Name), 'releaseName' (Release), 'cycleName' (Cycle), 'platform' (Platform/environment), 'executedVersion' (Executed Version of the test case), 'executionStatus' (Execution Status label), 'tcRunID' (numeric Test Run ID), and 'testRunUdfs' (array of objects each with name, label, fieldID, fieldType, value — use 'label' for display headers, null if not set). ALL project-defined UDF fields are always included, even those with no value. Top-level 'hasTcRunUdf' flag indicates whether the project has Test Run UDFs configured. When false, a 'testRunUdfNote' field provides a professional explanation instead.",
|
|
1054
1128
|
readOnly: true,
|
|
1055
1129
|
idempotent: true
|
|
1056
1130
|
}
|