qase_case_upsert
Create a new test case or update an existing one by ID in Qase. Handles classic or Gherkin steps, shared steps, and normalizes enum labels or IDs.
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) 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 | ||
| type | No | Type label or numeric ID | |
| layer | No | Layer label or numeric ID | |
| steps | No | ||
| title | Yes | Test case title | |
| status | No | Status label or numeric ID | |
| behavior | No | Behavior label or numeric ID | |
| is_flaky | No | ||
| 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 | ||
| automation | No | Automation status (label, slug, or numeric ID: 0=Manual / is-not-automated, 1=To be automated, 2=Automated) | |
| steps_type | No | ||
| attachments | No | Attachment hashes from qase_attachment_upload | |
| description | No | ||
| custom_field | No | ||
| milestone_id | No | ||
| preconditions | No | ||
| postconditions | No |