Edit an existing test case
editTestCasePartially updates an existing test case. Only the fields provided are changed; omitted fields are left as-is. STEPS content: 'steps' can be individually replaced or deleted by 0-based index, and new steps appended. TEXT content: set 'text.stepsText' / 'text.expectedResultText' (empty string clears, omit keeps). BDD content: set 'bddScenarios' to gherkin source (empty string clears, omit keeps). The 'template' field switches which content is displayed; every template's content is preserved. Content must belong to the displayed template: writing 'steps' to a TEXT/BDD case (or vice versa) is rejected with status "content_does_not_match_template" and nothing is written - pass 'template' in the same call to switch first. Pass the '_etag' from the last read to have the edit rejected instead of overwriting a change somebody else made in the meantime.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"testCaseId": "<testCaseId>"
},
"name": "editTestCase"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Updates for the TEXT-template content. A test case normally uses EITHER the STEPS 'steps' array OR this TEXT content; 'template' selects which is shown. Omitted fields are kept. | |
| _etag | No | Optional conflict tag from the last read or edit of this entity, for a safe read-modify-write: the edit is only applied while nobody else has changed the entity since. Pass it back verbatim, including an empty string. On a mismatch nothing is written and the call answers with status "update_conflict" and the current '_etag' to re-read from. Omit it to overwrite whatever is stored. | |
| steps | No | Partial updates for the STEPS-template steps, at most 48000 characters in all cells together. Every index refers to the original step list and is unaffected by deletions in the same call. Steps with delete=true are removed; others replace or append at that index. Only apply necessary updates. | |
| title | No | New title for the test case. Omit to keep the existing title. | |
| 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 | Switch which content template is displayed: "STEPS", "TEXT" or "BDD". Omit to keep the current one. Switching deletes no content - the other templates keep theirs, and switching back shows it again. A case switched back to STEPS gets its old steps back, and 'steps' indices refer to those although no read showed them while another template was displayed: switch first, re-read, then edit the steps. Content fields in this call are checked against the template set here (or the current one when omitted), so set it in the same call to write another template's content. | |
| testCaseId | Yes | The id of the test case to edit | |
| bddScenarios | No | New BDD-template content. Omit to keep it, pass an empty string to clear it. 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 update, keyed by the 'propName' that listProjects reports - 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). Only provided fields are changed. | |
| precondition | No | New precondition text - rich text in the chosen 'format'. Pass an empty string to clear it. Omit to keep the existing precondition. |
Output 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 |