Skip to content
developers
Open TestCollab

Export defects

POST/defects/export

Export the list of defects (in JSON format for CSV generation)

Use resource IDs from your own project. Keep the API token in your server or CI environment.

example.ts
import { createConfiguration, ExportApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);
const api = new ExportApi(config);
const result = await api.exportDefects({
"exportDefectsPayload": {
"project": 123,
"exportAs": "csv",
"criteria": "all",
"fields": []
}
});
console.log(result);
Field Type Required Description
project number Yes Project ID
export_as string Yes Export data as CSV/EXCEL Values: csv, excel.
filter_model string No Stringified filter object (Ag-grid filters)
sort_model string No Stringified array of sort model objects (Ag-grid sort models)
criteria string Yes Export selected or all defects. If none is selected and filter is present then all filtered defects will be considered. Values: all, selected.
defects Array of number No Selected defect IDs - will be considered only if criteria is selected.
fields Array of string Yes Fields provided here will be considered for export. If none then all default fields.
remove_tags boolean No Strip HTML tags from text fields
release number No Filter defects by release ID

200 — Export result with header row and defect data

Field Type Required Description
header_row string No Stringified header
testCases Array of string No Array of stringified test case data for export
Illustrative response
{
"header_row": "example",
"testCases": []
}
Status Meaning
401 Unauthorized
403 Forbidden
404 Not found
500 Internal server error