QTM4J: Link Test Cases to Test Cycle
qtm4j_link_test_cases_to_test_cycleLink test cases to a QTM4J test cycle by key or filter. Supports assignee, environment, and planned date.
Instructions
Link test cases to a QTM4J test cycle by test case keys or filter criteria. Test case keys are resolved to internal IDs and latest versions automatically.
Toolset: Test Cycles
Parameters:
cycleKey (string) required: Test Cycle key (e.g., 'SCRUM-TR-1'). Resolved to the internal cycle UID automatically.
testCaseKeys (array): Test case keys to link (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both.
filter (object): Filter criteria to select test cases to link. projectId is auto-filled from the active project context.
sort (string): Sort order in 'field:asc|desc' format (e.g., 'createdOn:desc'). Default is 'createdOn:desc'.
assignee (string): Jira account ID of the assignee for the linked executions.
environmentId (number): Environment ID from 'Get all environments in a project'.
buildId (number): Build ID from 'Get all builds in a project'.
actualTime (string): Actual time spent in HH:mm format (e.g., '02:30').
startNewExecution (boolean): Start a new execution for linked test cases. Default is false.
executionPlannedDate (string): Planned execution date in yyyy-MM-dd format (e.g., '2023-12-31').
qiGenerated (boolean): Flag indicating AI-generated test cases. Default is false.
Output Description: Confirmation with the cycle key and linked: true. Warnings included if any test cases could not be resolved or linked.
Use Cases: 1. Add specific test cases to a test cycle by key 2. Populate a test cycle with test cases matching a filter (e.g., all High priority test cases) 3. Link test cases from a specific folder to a test cycle 4. Add test cases to a cycle with a specific assignee or environment
Examples:
Link two test cases by key
{
"cycleKey": "SCRUM-TR-1",
"testCaseKeys": [
"SCRUM-TC-10",
"SCRUM-TC-11"
]
}Expected Output: Test cases linked to test cycle
Link test cases matching a filter with assignee
{
"cycleKey": "SCRUM-TR-1",
"filter": {
"priority": [
"High"
],
"status": [
"To Do"
]
},
"assignee": "5b10a2844c20165700ede21f",
"startNewExecution": true
}Expected Output: Filtered test cases linked to cycle with assignee
Link test cases in a folder to a cycle with planned date
{
"cycleKey": "SCRUM-TR-5",
"filter": {
"folderId": 42,
"withChild": true
},
"executionPlannedDate": "2024-03-31",
"sort": "key:asc"
}Expected Output: Folder test cases linked to cycle with planned date
Hints: 1. PREREQUISITE: set_project_context must be called before this tool. NEVER auto-select a project. 2. CYCLE KEY FORMAT: '{PROJECT_KEY}-TR-{id}' — e.g. 'SCRUM-TR-1'. Resolved to internal UID automatically. 3. TEST CASE KEY FORMAT: '{PROJECT_KEY}-TC-{number}' — e.g. 'SCRUM-TC-145'. 4. Provide either testCaseKeys or filter — not both. 5. projectId in filter is auto-filled from the active project context — do not set it manually. 6. filter.excludeCycleId excludes test cases already in another cycle. 7. startNewExecution: true creates a fresh execution record for each linked test case. 8. executionPlannedDate must be in yyyy-MM-dd format (e.g., '2024-03-31'). 9. actualTime must be in HH:mm format (e.g., '02:30'). 10. If a test case key cannot be resolved, it is reported in warnings and others are still linked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort order in 'field:asc|desc' format (e.g., 'createdOn:desc'). Default is 'createdOn:desc'. | |
| filter | No | Filter criteria to select test cases to link. projectId is auto-filled from the active project context. | |
| buildId | No | Build ID from 'Get all builds in a project'. | |
| assignee | No | Jira account ID of the assignee for the linked executions. | |
| cycleKey | Yes | Test Cycle key (e.g., 'SCRUM-TR-1'). Resolved to the internal cycle UID automatically. | |
| actualTime | No | Actual time spent in HH:mm format (e.g., '02:30'). | |
| qiGenerated | No | Flag indicating AI-generated test cases. Default is false. | |
| testCaseKeys | No | Test case keys to link (e.g., ['SCRUM-TC-1', 'SCRUM-TC-2']). Resolved to internal IDs and latest versions automatically. Provide this OR filter — not both. | |
| environmentId | No | Environment ID from 'Get all environments in a project'. | |
| startNewExecution | No | Start a new execution for linked test cases. Default is false. | |
| executionPlannedDate | No | Planned execution date in yyyy-MM-dd format (e.g., '2023-12-31'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linked | No | ||
| cycleKey | Yes | ||
| unlinked | No |