Custom Fields API
Retrieve all custom fields configured for test management entities in BrowserStack Test Management.
The Custom Fields API allows you to create, retrieve, update, and delete custom fields for test cases, test runs, and other entities. Use this API to dynamically build forms, validate data, or integrate with external systems.
Get custom fields
Use this endpoint to retrieve all custom fields configured in your BrowserStack Test Management project.
Request parameters
Request
curl -X GET \
https://test-management.browserstack.com/api/v2/custom-fields \
Response attributes 200 application/json
Response
{
"custom_fields":[
{
"id":"CF-5678",
"field_name":"Sample String",
"place_holder_text":"Sample Placeholder",
"field_type":"string",
"is_required":false,
"applies_to_all_projects":false,
"field_entity_type":"test_case",
"link_to_future_projects":false,
"assigned_projects":[
"project_123",
"project_456"
]
},
"..."
]
}
-
custom_fields Array
â–¶ SHOW VALUESList of custom field objects.
-
id String
Unique identifier of the custom field.
-
field_name String
Name of the custom field.
-
field_type String
Data type of the custom field (e.g., string, dropdown, text, user, boolean, url, date, int).
-
field_entity_type String
Entity type the custom field is associated with (e.g., test_case).
-
is_required Boolean
Indicates whether the custom field is required.
-
options Array
List of options for dropdown/multidropdown fields.
-
Create a custom field
Use this endpoint to create a new custom field for your BrowserStack Test Management project.
Request parameters
Request
curl -X POST \
https://test-management.browserstack.com/api/v2/custom-fields \
Request body
Request body
{
"field_name":"Sample Dropdown",
"place_holder_text":"Sample Placeholder",
"field_type":"dropdown",
"is_required":false,
"options":[
{
"is_default":false,
"option_value":"P0"
},
{
"is_default":false,
"option_value":"P1"
},
{
"is_default":false,
"option_value":"P2"
}
],
"applies_to_all_projects":false,
"field_entity_type":"test_case",
"link_to_future_projects":false,
"assigned_projects":[
"proj_1"
]
}
-
field_name* String
Name of the custom field.
-
place_holder_text String
Placeholder text for the custom field.
-
field_type* String
Data type of the custom field (e.g., string, dropdown, text, user, boolean, url, date, int).
-
is_required Boolean
Whether the custom field is required.
-
options Array
List of options for dropdown/multidropdown fields.
- Show 4 more
-
applies_to_all_projects Boolean
Whether the field applies to all projects.
-
field_entity_type* String
Entity type the custom field is associated with (e.g., test_case).
-
link_to_future_projects Boolean
Whether to link the field to future projects.
-
assigned_projects Array
List of project IDs to assign the field to.
Response attributes 200 application/json
Response
{
"success":true,
"custom_field":{
"id":"CF-1234",
"field_name":"Sample String",
"place_holder_text":"Sample Placeholder",
"field_type":"string",
"is_required":false,
"applies_to_all_projects":false,
"field_entity_type":"test_case",
"link_to_future_projects":false,
"assigned_projects":[
"proj_1",
"proj_2"
]
}
}
-
success Boolean
Indicates if the custom field was created successfully.
-
custom_field Object
â–¶ SHOW VALUESThe created custom field object.
-
id String
Unique identifier of the custom field.
-
field_name String
Name of the custom field.
-
field_type String
Data type of the custom field (e.g., string, dropdown, text, user, boolean, url, date, int).
-
field_entity_type String
Entity type the custom field is associated with (e.g., test_case).
-
is_required Boolean
Indicates whether the custom field is required.
-
options Array
List of options for dropdown/multidropdown fields.
-
Update a custom field
Use this endpoint to update an existing custom field.
Request parameters
Request
curl -X PATCH \
https://test-management.browserstack.com/api/v2/custom-fields/{custom_field_id} \
Request body
Request body
{
"field_name":"Sample String",
"place_holder_text":"Sample Placeholder",
"field_type":"string",
"is_required":false,
"applies_to_all_projects":false,
"field_entity_type":"test_case",
"link_to_future_projects":false,
"assigned_projects":[
"proj_1",
"proj_2"
]
}
-
field_name* String
Name of the custom field.
-
place_holder_text String
Placeholder text for the custom field.
-
field_type* String
Data type of the custom field (e.g., string, dropdown, text, user, boolean, url, date, int).
-
is_required Boolean
Whether the custom field is required.
-
applies_to_all_projects Boolean
Whether the field applies to all projects.
-
field_entity_type* String
Entity type the custom field is associated with (e.g., test_case).
-
link_to_future_projects Boolean
Whether to link the field to future projects.
-
assigned_projects Array
List of project IDs to assign the field to.
Response attributes 200 application/json
Response
{
"data": {
"custom_field": {
"id": "cf-456",
"field_name": "Priority",
"field_type": "dropdown",
"field_entity_type": "test_case",
"is_required": true,
"options": [
{ "option_value": "Low", "is_default": false },
{ "option_value": "Medium", "is_default": false },
{ "option_value": "High", "is_default": true }
]
}
}
}
-
data Object
â–¶ SHOW VALUESThe response data object.
-
id String
Unique identifier of the custom field.
-
field_name String
Name of the custom field.
-
field_type String
Data type of the custom field (e.g., string, dropdown, text, user, boolean, url, date, int).
-
field_entity_type String
Entity type the custom field is associated with (e.g., test_case).
-
is_required Boolean
Indicates whether the custom field is required.
-
options Array
List of options for dropdown/multidropdown fields.
-
Delete a custom field
Use this endpoint to delete a custom field by its unique identifier.
Request parameters
Request
curl -X DELETE \
https://test-management.browserstack.com/api/v2/custom-fields/{custom_field_id} \
-
custom_field_id* string
Unique identifier for the custom field to delete.
Response attributes 200 application/json
Response
{
"success": true
}
-
success Boolean
Indicates if the custom field was deleted successfully.
Validations for fields
When you create or update custom fields using our API, each parameter in your request payload must meet specific validation rules. This guide details the requirements for each field to ensure your API calls succeed. Refer to this table to understand the data types, character limits, and constraints for each parameter.
Note: For fields that accept a specific list of values, ensure your input is in lowercase. For example, use
test_caseinstead ofTest_Case, andstringinstead ofString.
| Field | Validation |
|---|---|
field_entity_type |
Field can have a value of either test_case or test_result. |
name |
Required. • Globally unique (case-sensitive). • Regex: ^[a-zA-Z0-9\-\_]+$• Max length: 32 characters. |
type |
Required. • Allowed values: String, TextArea, Integer, Boolean, Dropdown, MultiSelectDropdown, Date, URL, User. |
place_holder_text |
Optional. • Allowed for all types except for Date.• Max length: 150 characters. |
required |
Optional. • Default = false. |
assigned_projects |
Optional. • An array of project IDs to associate the field with. |
applies_to_all_projects |
Optional. • Default = false.• If assigned_projects is present, applies_to_all_projects cannot be true. |
link_to_future_projects |
Optional. • Default = false. |
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.