Copy test cases to other project
POST
/testcases/copyToOtherProjectBulk copy of Test Cases
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, TestCasesApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new TestCasesApi(config);
const result = await api.copyToOtherProject({ "copyToOtherProjectPayload": { "ids": [], "project": 123, "targetProject": 123 }});console.log(result);curl --request POST \ "https://api.testcollab.io/testcases/copyToOtherProject?token=$TESTCOLLAB_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "ids": [], "project": 123, "target_project": 123, "target_suite": 123, "reviewer": 123, "do_not_copy_suites": true}'Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
ids |
Array of number | Yes | — |
project |
integer | Yes | — |
target_project |
number | Yes | — |
target_suite |
number | No | — |
reviewer |
integer | No | Applicable only when review feature is enabled |
do_not_copy_suites |
boolean | No | If true, suites will not be copied |
Response
Section titled “Response”200 — Test Case copied
| Field | Type | Required | Description |
|---|---|---|---|
status |
boolean | Yes | — |
affected |
number | No | — |
details |
Array of Bulk Action Result Detail | No | — |
message |
string | Yes | — |
queue |
Background job | No | — |
queue.id |
number | Yes | — |
queue.status |
number | Yes | 0=queued; 1=in-progress; 2=done; 3=failed |
queue.percent_done |
number | Yes | When status =1, this will indicate progress % |
queue.created_at |
string | Yes | — |
queue.updated_at |
string | Yes | — |
queue.results |
string | No | JSON object |
{ "status": true, "affected": 123, "details": [], "message": "example", "queue": { "id": 123, "status": 123, "percent_done": 123, "created_at": "example", "updated_at": "example", "results": "example" }}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
403 |
Forbidden |