Assign test plan to users
POST
/testplans/assignAssign test plan to users
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, TestPlansAssignmentApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new TestPlansAssignmentApi(config);
const result = await api.assignTestPlan({ "testplan": 123, "project": 123, "testPlanAssignmentPayload": { "executor": "me", "project": 123, "testplan": 123 }});console.log(result);curl --request POST \ "https://api.testcollab.io/testplans/assign?token=$TESTCOLLAB_TOKEN&testplan=123&project=123" \ --header 'Content-Type: application/json' \ --data '{ "executor": "me", "assignment_criteria": "configuration", "assignment_method": "automatic", "assignment": { "user": [], "testCases": { "testCases": [], "selector": [] }, "configuration": [] }, "project": 123, "testplan": 123, "override_existing_assignees": true}'Parameters
Section titled “Parameters”| Name | Location | Type | Required | Description |
|---|---|---|---|---|
testplan |
query | integer | Yes | Test Plan ID |
project |
query | integer | Yes | Project ID |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
executor |
string | Yes | Values: me, team. |
assignment_criteria |
string | No | Values: configuration, testCase. |
assignment_method |
string | No | Values: automatic, manual. |
assignment |
object | No | Only allowed in case of assignment_method = manual. Children objects - testCases and configuration are nullable based on assignment_criteria’s value |
assignment.user |
Array of number | Yes | User ID |
assignment.testCases |
Test Case Ref Collection | Yes | This should be null in case of assignment_criteria = configuration |
assignment.testCases.testCases |
Array of number | No | Array of test case IDs |
assignment.testCases.selector |
Array of Filter Query | No | FilterQuery object to match test cases |
assignment.configuration |
Array of number | Yes | Configuration ID, This should be null in case of assignment_criteria = testCase |
project |
integer | Yes | — |
testplan |
integer | Yes | — |
override_existing_assignees |
boolean | No | When false (default) the assignment rules are applied only to test cases that are still unassigned, preserving assignees inherited from the test case default and assignees already picked inside the test plan. When true the rules are applied to every test case, replacing existing assignments. |
Response
Section titled “Response”200 — Assignment result
{}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not found |
500 |
Internal server error |