create_test_run
Create a Zephyr Scale test run with its complete test case list and execution results in one call. Define the run composition at creation because it cannot be changed later via the public API.
Instructions
Create a test run / test cycle (POST /testrun). Pass the COMPLETE list of test cases in items now — API v1 limitation: a test run is IMMUTABLE — there is no PUT /testrun, so it cannot be renamed, moved or have cases added/removed through the public API; its items are fixed at creation and the run status is derived from item statuses. Escape hatches: recreate_test_run_with_items (public, new key) or the internal-API tools update_test_run / add_test_cases_to_run / remove_test_cases_from_run (same key, require ZEPHYR_ALLOW_INTERNAL_API=true). Each item may also carry its execution result (status, executedBy, executionTime, actual dates, per-step scriptResults, …), which imports a run together with its results in one call; afterwards use the test result tools. A run folder is of type TEST_RUN. The folder MUST already exist — the API never creates folders implicitly (use create_folder first). Default statuses: 'Not Executed', 'In Progress', 'Pass', 'Fail', 'Blocked' — case-sensitive internal names; instances may define custom ones. The run's own status is derived by the server from its item statuses and uses a different vocabulary from the execution statuses above ('Not Executed' / 'In Progress' / 'Done'). A run CANNOT be linked to Jira issues: issueLinks is rejected locally because the API has no such field on a run — link the issues on the test cases instead. Returns { key } of the new run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Test run name; it cannot be changed later through the public API | |
| items | No | Test cases to include — the ONLY place where the composition of a run can be set. Each entry requires testCaseKey and may carry the execution result fields of that item (status, environment, executedBy, assignedTo, comment, executionTime, actualStartDate, actualEndDate, customFields, issueLinks, scriptResults). | |
| owner | No | Owner. Jira *user key* (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user. | |
| folder | No | Full path of an existing TEST_RUN folder from the root starting with "/", e.g. "/Regression" | |
| version | No | Free-text version label | |
| iteration | No | Free-text iteration label | |
| issueLinks | No | NOT SUPPORTED for test runs and rejected locally: the API has no such field on its run DTO, so any value (an empty array included) makes POST /testrun answer HTTP 500 and create nothing. Link them with link_issues_to_test_run (internal API) or on the test cases (create_test_case / update_test_case with issueLinks). | |
| projectKey | No | Jira project key, e.g. "PROJ"; defaults to ZEPHYR_DEFAULT_PROJECT_KEY when omitted | |
| testPlanKey | No | Test plan to associate the run with, e.g. PROJ-P123 | |
| customFields | No | Custom field values keyed by field name | |
| plannedEndDate | No | ISO 8601 (passed through as-is) | |
| plannedStartDate | No | ISO 8601, e.g. 2026-07-20T00:00:00Z (passed through as-is) |