Add or Update Test Cases in a Test Manager Test Run
tm.add_testCasesToTestRunAdd test cases to a test run, updating assignee or priority if the case already exists for the same environment. Merges new cases without removing existing ones.
Instructions
Adds one or more test cases (each optionally with an environment_id, assignee user ID - see tm.get_organizationUsers to look one up - and priority) to an existing LambdaTest Test Manager test run, WITHOUT removing test cases already in the run. If a test case is already in the run with the same environment_id, this UPDATES its assignee/priority instead of adding a duplicate - so it's also how you reassign or reprioritize an existing test case instance, not just add new ones. Internally fetches the run's current test cases first and PUTs the complete merged list back, since the underlying API replaces the run's entire test case list on every update - calling this repeatedly is safe. A test case can be present multiple times with different environment_id values to run it against multiple environments. environment_id/assignee/priority are all optional per test case - omitting environment_id defaults to a placeholder 'No config selected' environment. Get a valid environment_id from tm.get_environments (or read one off an existing test-run instance via tm.get_testRunById). DANGER: only ever pass an environment_id from one of those two sources - a nonexistent environment_id does NOT return an error, it corrupts the run so badly that every subsequent read of it (tm.get_testRunById, tm.get_testCaseInstancesByTestRunId) starts failing with a 500 server error until repaired by another update. Do not call this speculatively - it's a real, persistent action. KANEAI RUNS: works on both manual and KaneAI test runs (see tm.create_testRun's is_auteur_generated input for creating one), but every test case passed in must match the run's own type - refuses the entire call (no partial changes) if any test case's own is_auteur_generated does not match the run's. Manual test cases cannot enter a KaneAI run and vice versa. This is NOT the same thing as the run's is_editable flag, which reflects KaneAI schedule ownership, not manual/KaneAI compatibility.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_cases | Yes | ||
| test_run_id | Yes |