Skip to content
developers
Open TestCollab

Get custom fields

GET/customfields/{id}

Get custom fields

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

example.ts
import { createConfiguration, CustomFieldsApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);
const api = new CustomFieldsApi(config);
const result = await api.getCustomField({
"id": 123
});
console.log(result);
Name Location Type Required Description
id path number Yes Custom Field ID

200 — Selected custom field

Field Type Required Description
id number Yes —
sort_order number No —
name string Yes —
label string Yes —
entity string No —
type Custom Field Type Yes —
default_value string Yes NULL if default value not specified, Number type for dropdown field and date, string types for other
is_required boolean Yes —
add_to_all_projects boolean No Should link with all projects?
projects Array of number No Project IDs in array. Can only be specified if add_to_all_projects is false
search boolean No Weather to make this field searchable or not
extra Custom Field Extra Props No —
extra.options Array of object No This is expected when field type is dropdown
extra.act_as_config boolean No Expected when custom field’s entity is TestPlan, In case of true, it will be available under config section while creating a new test plan
company number Yes Company ID
description string No —
is_sortable boolean No —
Illustrative response
{
"id": 123,
"sort_order": 123,
"name": "example",
"label": "example",
"entity": "example",
"type": "text",
"default_value": "example",
"is_required": true,
"add_to_all_projects": true
}
Status Meaning
403 Forbidden