Skip to content

Add cases to an open manual or mixed run

POST
/v1/runs/{id}/cases
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).

id
required
string
Media type application/json
object
testCaseIds
required

The cases to add, by id.

Array<string>
>= 1 items <= 10000 items
Example
{
"testCaseIds": [
"6f1c2b3a-0000-4000-8000-0000000000c1"
]
}

What was added, and what was skipped and why

Media type application/json
object
added
required

The ids the run now expects, in the order sent.

Array<string>
skipped
required
Array<object>
object
id
required
string
reason
required

in_run — the run already holds the case; not_found — no such case in the project, or it is in the Bin.

string
Allowed values: in_run not_found
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

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No / invalid token or session

read-only member of the project — a reader adds nothing

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No such run in your projects

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The run is finished or terminated, or is not manual or mixed

Media type application/json
object
error
required
string
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.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over