Unlink a defect from an executed test case
/defects/{id}/unlinkRequires the project’s existing manageDefect permission. Removes the selected defect record’s test case, test plan, execution, plan test case, revision, and step associations. The defect remains in the project’s defects list, and the underlying external or inbuilt issue is preserved. Other defect records and their associations, execution results, and existing history are unchanged. Records the actor, defect, test case, and test plan in a project activity. The executedtestcase must match the selected defect record’s current link. Requests for an already unlinked defect fail without adding another activity.
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, DefectsApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new DefectsApi(config);
const result = await api.unlinkDefect({ "unlinkDefectPayload": { "project": 123, "executedtestcase": 123 }, "id": 123});console.log(result);curl --request PUT \ "https://api.testcollab.io/defects/123/unlink?token=$TESTCOLLAB_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "project": 123, "executedtestcase": 123}'Parameters
Section titled “Parameters”| Name | Location | Type | Required | Description |
|---|---|---|---|---|
id |
path | integer | Yes | ID of the TestCollab defect record, not the external issue ID |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
project |
integer | Yes | Project containing the defect |
executedtestcase |
integer | Yes | Execution currently linked to the selected defect record. Use the record’s executedtestcase value, including when viewing a defect from an earlier run. |
Response
Section titled “Response”200 — Defect unlinked and project activity recorded
{}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
Missing or invalid project, defect, or executed test case ID |
401 |
Authentication required |
403 |
Project access or manageDefect permission denied |
404 |
Defect not found in the requested project |
409 |
Defect is not linked to the specified executed test case |