Resource: Custom Fields ( /api/customfields )
Custom fields (collection) resource
Root Relation: CustomFields
This resource supports the following methods: GET, POST
Methods
GET
Retrieves all custom fields.
This method supports the OData parameters $filter, $top, $take, $orderby and $inlinecount. See OData Topic for more details.
Status Codes
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).
Status | Description |
---|---|
200 - OK | Returned if the request was completed successfully. |
404 - NotFound | Returned if the custom field type does not exist. |
An Example of fetching all custom fields.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json |
Response Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json; charset=utf-8 |
Response Body
Code Block | ||
---|---|---|
| ||
{ "Items": [ { "Id": "4b4329a0-44a3-4e3c-a527-6973bb2b063b", "Name": "IsRegression", "CustomFieldTypeName": "Checkbox", "Label": "Is Regression?", "Description": null, "Required": false, "Entities": [ "TestScript", "Requirement", "Incident" ], "Scopes": [ { "Type": "Project", "Id": "d17289f6-8f43-4074-88d0-3841f9830b19", "Name": "Test Project" } ], "Expands": [ "Configuration", "Options", "Type" ], "Self": "http://localhost/api/customfield/IsRegression", "Links": [ { "Href": "http://localhost/api/customfieldtype/checkbox", "Rel": "CustomFieldType" } ] }, { "Id": "8b385cac-fcbf-4d27-83d0-132e121e8ea1", "Name": "Severity", "CustomFieldTypeName": "ComboBox", "Label": "Severity", "Description": null, "Required": true, "Entities": [ "Incident" ], "Scopes": [ { "Type": "Organisation", "Id": "3d0d2ebf-d9c4-40bb-ab8e-85d63dab1f8a", "Name": "Testing Intl" } ], "Expands": [ "Configuration", "Options", "Type" ], "Self": "http://localhost/api/customfield/Severity", "Links": [ { "Href": "http://localhost/api/customfieldtype/combobox", "Rel": "CustomFieldType" } ] } ] } |
Status Code
200 - OK
An Example of fetching subset of custom fields using OData filter and expansion for options.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
$filter | CustomFieldTypeName eq 'ComboBox' | Fetch all custom fields of type combo box. |
$expand | Options | Expands the options for any matching field. |
Response Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json; charset=utf-8 |
Response Body
Code Block | ||
---|---|---|
| ||
{ "Items": [ { "Id": "8b385cac-fcbf-4d27-83d0-132e121e8ea1", "Name": "Severity", "CustomFieldTypeName": "ComboBox", "Label": "Severity", "Description": null, "Required": true, "Entities": [ "Incident" ], "Scopes": [ { "Type": "Organisation", "Id": "3d0d2ebf-d9c4-40bb-ab8e-85d63dab1f8a", "Name": "Testing Intl" } ], "Expands": [ "Configuration", "Type" ], "Options": [ { "Identifier": "05ec42ae-2713-4d51-9306-3226a2446712", "Text": "Low" }, { "Identifier": "05ec42ae-2713-4d51-9306-3226a2446712", "Text": "Medium" }, { "Identifier": "05ec42ae-2713-4d51-9306-3226a2446712", "Text": "High" } ], "Self": "http://localhost/api/customfield/Severity", "Links": [ { "Href": "http://localhost/api/customfieldtype/combobox", "Rel": "CustomFieldType" } ] } ] } |
Status Code
200 - OK
POST
Add a new custom field.
Status Codes
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).
Status | Description |
---|---|
201 - Created | Returned if the custom field is created successfully. |
409 - Conflict | Returned if the custom field already exists. |