create_test_case
Create a Jira/Zephyr test case with name, folder, owner, and optional script, parameters, or custom fields; the target folder must already exist. Returns the new case key and URL.
Instructions
Create a test case (POST /testcase). The folder MUST already exist — the API never creates folders implicitly (use create_folder first). status, priority, component and custom field names must match the ones configured on the instance and are case-sensitive: an unknown or wrong-case value is rejected with 400 and nothing is created (unlike EXECUTION statuses, which the API silently ignores). owner: Jira user key (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user. estimatedTime is in milliseconds. name is limited to 255 characters — a longer one is refused locally, because the API answers it with an opaque bodyless HTTP 500. testScript is STEP_BY_STEP with steps, or PLAIN_TEXT/BDD with text; a step carrying testCaseKey is a "Call to Test" that inlines another case. BDD text is stored verbatim and must contain Gherkin step lines only — a "Feature:"/"Scenario:" header is rejected with 400 "Invalid BDD Script". Omitting testScript does NOT leave the case script-less: the server attaches an empty PLAIN_TEXT script, which add_test_steps treats as "no script yet". Returns { key, url }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Test case name | |
| owner | No | Owner. Jira *user key* (e.g. 'JIRAUSER10000'), NOT a username or e-mail — resolve it with find_jira_user. | |
| folder | No | Full folder path from the root starting with "/", e.g. "/Regression/Payments". The folder MUST already exist — the API never creates folders implicitly (use create_folder first). | |
| labels | No | Labels; the API replaces spaces with underscores | |
| status | No | Test case status. Defaults: 'Draft', 'Approved', 'Deprecated' — case-sensitive; instances may define custom ones. | |
| priority | No | Priority. Defaults: 'High', 'Normal', 'Low' — case-sensitive; instances may define custom ones. | |
| component | No | Name of a Jira component of the project | |
| objective | No | Objective (HTML allowed) | |
| issueLinks | No | Jira issue keys to link, e.g. ["PROJ-123"] | |
| parameters | No | Test case parameters: { variables: [{name, type: FREE_TEXT | DATA_SET, dataSet?}], entries: [{<variable>: <value>}] } | |
| projectKey | No | Jira project key, e.g. "PROJ"; defaults to ZEPHYR_DEFAULT_PROJECT_KEY when omitted | |
| testScript | No | Test script. STEP_BY_STEP: {type, steps: [{description?, testData?, expectedResult?, testCaseKey?}]}; PLAIN_TEXT/BDD: {type, text}. | |
| customFields | No | Custom field values keyed by field name | |
| precondition | No | Precondition (HTML allowed) | |
| estimatedTime | No | Estimated duration in milliseconds |