set_test_script
Replace a Zephyr Scale test case's full script or switch its format; missing steps are deleted and the stored write is read back.
Instructions
Replace a test case's whole script or change its format (PUT /testcase/{testCaseKey} with a full testScript). DESTRUCTIVE: switching STEP_BY_STEP to PLAIN_TEXT or BDD irreversibly deletes all steps, and a STEP_BY_STEP replacement deletes every stored step whose id is absent from steps. text is required for PLAIN_TEXT and BDD, steps for STEP_BY_STEP — the pairing is validated locally, before any request — but steps: [] passes that check and DELETES every stored step, leaving an empty STEP_BY_STEP script. BDD text is stored verbatim and must contain Gherkin step lines only, no "Feature:"/"Scenario:" header (400 "Invalid BDD Script"). A step whose "Call to Test" points at its own case is refused locally: the API answers 2xx to such a write and stores NOTHING. After the write the tool reads the case back (a second 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). 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Script body — required for PLAIN_TEXT and BDD (Gherkin step lines only), rejected for STEP_BY_STEP | |
| type | Yes | New script format: STEP_BY_STEP, PLAIN_TEXT or BDD | |
| steps | No | Complete final list of steps — required for STEP_BY_STEP, rejected otherwise. Steps omitted here are deleted; keep the ids from get_test_case to update steps in place. | |
| testCaseKey | Yes | Test case key, e.g. PROJ-T123 |