Add cases to an open manual or mixed run
const url = 'https://beta-api.plune.ai/v1/runs/example/cases';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"testCaseIds":["6f1c2b3a-0000-4000-8000-0000000000c1"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/runs/example/cases \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "testCaseIds": [ "6f1c2b3a-0000-4000-8000-0000000000c1" ] }'«Add tests» on the run page (#1233): cases from the tree, or a plan’s — the page reads the plan once and sends its cases. The run must be open (scheduled, launched or rerun) and manual or mixed; its configuration.expected grows by the cases it does not hold yet, in the order sent. A case the run already holds — expected by it, or already marked — is skipped as in_run: one case, one result. A case that is not in the project, or is in the Bin, is skipped as not_found. Two people adding the same case at once add it once. When the launch copied who runs what (assignment: prefer-assignee), an added case brings its assignee along. Written to the audit log as an update of the run. A reader is refused (403).
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”object
The cases to add, by id.
Example
{ "testCaseIds": [ "6f1c2b3a-0000-4000-8000-0000000000c1" ]}Responses
Section titled “ Responses ”What was added, and what was skipped and why
object
The ids the run now expects, in the order sent.
object
in_run — the run already holds the case; not_found — no such case in the project, or it is in the Bin.
Example
{ "added": [ "6f1c2b3a-0000-4000-8000-0000000000c1" ], "skipped": [ { "id": "3f2b9d3e-9d0c-4d3e-8b55-0a7e3a1c2b10", "reason": "in_run" } ]}Invalid body — no id, more than 10 000, or not JSON
object
Example generated
{ "error": "example"}No / invalid token or session
read-only member of the project — a reader adds nothing
object
Example generated
{ "error": "example"}No such run in your projects
object
Example generated
{ "error": "example"}The run is finished or terminated, or is not manual or mixed
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over