update_test_case
Update an existing Jira test case's fields, script, or links. Only provided fields change; test steps sync by ID—send the complete list to avoid deletions.
Instructions
Update a test case (PUT /testcase/{testCaseKey}). PARTIAL: only the fields passed are changed and omitted fields keep their values, so never send empty placeholders. projectKey cannot be changed. issueLinks REPLACES the whole link set instead of adding to it — sending issueLinks: ["PROJ-1"] to a case already linked to PROJ-2 silently unlinks PROJ-2, so read the current links with get_test_case and send the complete final list (link_issues_to_test_cases is the additive alternative). testScript.steps is synchronized BY ID — a step without an id is created, a step with an id is updated, and every stored step whose id is missing from the list is DELETED; always send the complete final list, carrying over the ids from get_test_case. To only add steps use add_test_steps, which does that read-merge-write safely. A name longer than 255 characters is refused locally: the API stores the first 255 characters and still reports success. A step whose "Call to Test" points at its own case is refused locally too: the API answers 2xx to such a write and stores NOTHING, throwing away the other steps of the same request with it. When (and only when) testScript is passed, the tool reads the case back afterwards (one extra GET) and compares the STORED script with the one sent — its type, the step count for STEP_BY_STEP, and that a non-empty text survived for PLAIN_TEXT/BDD (the text itself is not compared byte-for-byte); an update without testScript costs no extra request. The folder MUST already exist — the API never creates folders implicitly (use create_folder first). Returns { key, url }; when the stand accepted the write and kept the old script, the answer also carries storedType, storedSteps and a warning saying what is really stored, and a warning alone when the read-back itself failed. Only the script is verified: the other fields of a partial update are not read back.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | 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>}] } | |
| testScript | No | Test script. STEP_BY_STEP: {type, steps: [{description?, testData?, expectedResult?, testCaseKey?}]}; PLAIN_TEXT/BDD: {type, text}. | |
| testCaseKey | Yes | Test case key, e.g. PROJ-T123 | |
| customFields | No | Custom field values keyed by field name | |
| precondition | No | Precondition (HTML allowed) | |
| estimatedTime | No | Estimated duration in milliseconds |