Create or update test case
qase_case_upsertCreate or update a single test case in Qase. Provide an ID to update an existing case, or omit it to create a new one.
Instructions
Create or update a single test case. With id it updates that case, without id it creates a new one. Enum fields (priority, severity, type, layer, behavior, automation, is_flaky) accept either a label such as "high" or "blocker" or the project's numeric ID — the server normalizes both. Steps can be classic action/expected pairs or Gherkin, and may reference shared steps by hash. Writing more than one case? Use qase_case_bulk_create instead: it takes a list and sends one request. If the project has "Test case review" enabled, direct writes may need to go through a review — run qase_discover_tools with "review" for those tools. Cost: one API call, about 0.6s to create and 0.4s to update. Ten sequential calls measured 5.6s against 1.2s for one qase_case_bulk_create writing the same ten, so a loop is roughly four times slower.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Case ID — if provided, updates the case; if omitted, creates a new one | |
| code | Yes | Project code (2-10 uppercase letters, numbers, or underscores) | |
| tags | No | Tag names, e.g. ["smoke", "billing"] | |
| type | No | Type label or numeric ID | |
| layer | No | Layer label or numeric ID | |
| steps | No | Ordered test steps; omit for a case without steps | |
| title | Yes | Test case title | |
| status | No | Status label or numeric ID | |
| behavior | No | Behavior label or numeric ID | |
| is_flaky | No | Is flaky label or numeric ID (0=No, 1=Yes). A boolean is accepted too. | |
| priority | No | Priority label or numeric ID (0=not set, 1=high, 2=medium, 3=low) | |
| severity | No | Severity label or numeric ID | |
| suite_id | No | ID of the suite that holds the case | |
| automation | No | Automation status (label, slug, or numeric ID: 0=Manual / is-not-automated, 1=To be automated, 2=Automated) | |
| steps_type | No | How steps are written: "classic" action/expected pairs, or "gherkin" scenario text | |
| attachments | No | Attachment hashes from qase_attachment_upload | |
| description | No | Free-form description of what the case covers | |
| custom_field | No | Custom field values keyed by field ID, e.g. { "12": "value" } | |
| milestone_id | No | ID of the milestone the case belongs to | |
| preconditions | No | State the system must be in before the steps run | |
| postconditions | No | State to restore or verify after the steps run |