Create a new test case
createTestCaseCreates a new test case in a given project with an optional precondition, optional folder and optional custom fields. Use the 'template' field to choose the content template: STEPS (interleaved 'steps' of action + expected result), TEXT (free-form 'text.stepsText' and 'text.expectedResultText' documents) or BDD ('bddScenarios' gherkin source). Provide the content for exactly one of them: a content field the chosen template does not display is rejected (status "content_does_not_match_template") rather than stored where nobody sees it.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Content for the TEXT template, as two free-form documents. A test case normally uses EITHER the top-level STEPS 'steps' array OR this TEXT content, not both; the 'template' field decides which is shown. | |
| steps | No | The STEPS-template steps (interleaved action + expected result per step). Use this OR the TEXT 'text' content, not both. Omit if the test case has no steps. | |
| title | Yes | The title of the test case, descriptive but not too long | |
| folder | No | The test case folder title or key or ID. If multiple folders match, the first one is used. If omitted, the test case is created in no folder - use 'moveTestCases' with targetFolderId=0 to put it back there later. | |
| format | No | Format for rich-text fields (descriptions, preconditions, comments, step & result cells, stepsText & expectedResultText) on both input and output: 'markdown' (default) or 'xml'. Read the matching rich-text format reference resource before producing either. Use 'xml' for BOTH the read and the write whenever you are changing a field that already has content: markdown cannot carry an underline or a text color, so an edit written as markdown writes those away. 'markdown' is for writing new content and for reading you will not edit. | |
| project | Yes | Project ID (number or string), project key or part of the project name | |
| template | No | Which content template to display: "STEPS" for interleaved action/expected-result steps, "TEXT" for free-form actions and expected-result documents, "BDD" for gherkin scenarios. Defaults to STEPS, or to the template of whichever single content field is provided. Provide content for the chosen template only - content another template would display is rejected, not stored invisibly. | |
| bddScenarios | No | Content for the BDD template. Gherkin source for the BDD template - feature/scenario lines as plain text, exactly as a .feature file would carry them. Always plain gherkin regardless of 'format', and it is not parsed or validated, so malformed gherkin is stored as sent. A top-level `Feature:` line is optional - scenarios on their own are fine. A `# language:` directive is honored; otherwise the dialect is detected from the keywords. | |
| customFields | No | Custom field values to set, keyed by the 'propName' that listProjects reports for the project - custom fields carry a 'cf__' prefix, built-in ones do not. A bare name or a single-underscore 'cf_' prefix is accepted too, but a key that is itself a propName always means that field. | |
| precondition | No | An optional precondition for the test case - rich text in the chosen 'format' |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _etag | No | Conflict tag of the entity - pass it to an edit tool's '_etag' to have that edit rejected if somebody changed the entity in the meantime. Empty for an entity that carries no tag yet. | |
| status | Yes | ||
| testCaseId | No |