Resource: Custom Field ( /api/customfield/{name} )
Custom field resource
This resource supports the following methods: DELETE, GET, PATCH
Methods
DELETE
Delete a 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 |
---|---|
204 - NoContent | Returned if delete was successful. |
404 - NotFound | Returned if custom field does not exist. |
GET
Retrieves a custom field by its identifier.
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. |
Example of retrieving a custom field by its name.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
{name} | IsRegression | The name of the custom field to retrieve. |
Response Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json; charset=utf-8 |
Response Body
{ "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" } ] }
Status Code
200 - OK
PATCH
Updates an existing custom field.
Currently the Patch operation is limited to working with picklist values of those custom fields which support it only.
Required Permissions
- Project/EditProjectPickLists
- Administration/Organisation/EditOrganisationPickLists
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 |
---|---|
204 - NoContent | Returned if it updated the custom field successfully. |
403 - Forbidden | Returned if ET would not complete request (normally due to a validation failure or you don't have the necessary permissions to complete the request). |
404 - NotFound | Returned if the custom field does not exist. |
Example - PATCH (add a picklist value)
Create a new picklist value.
Request Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Request Body
{ "update": { "pickListValues": [{ "add": { "ownerId": "d31d4c3e-dfea-4204-a9dd-a54f00b8af79", "text": "Test 3", "sortOrder": 3 } }] } }
Status Code
204 - No Content
Example - PATCH (modify an existing picklist value)
Create a new picklist value.
Request Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Request Body
{ "update": { "pickListValues": [{ "set": { "ownerId": "d31d4c3e-dfea-4204-a9dd-a54f00b8af79", "id": "08c84773-e7dc-4ab8-929b-8ee04a18c368", "text": "Test 4", "sortOrder": 2 } }] } }
Status Code
204 - No Content
Example - PATCH (remove an existing picklist value)
Request Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Request Body
{ "update": { "pickListValues": [{ "remove": { "ownerId": "d31d4c3e-dfea-4204-a9dd-a54f00b8af79", "id": "08c84773-e7dc-4ab8-929b-8ee04a18c368" }] } } }
Status Code
204 - No Content
Example - PATCH (add and remove in the same call)
Request Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Request Body
{ "update": { "pickListValues": [{ "remove": { "ownerId": "d31d4c3e-dfea-4204-a9dd-a54f00b8af79", "id": "08c84773-e7dc-4ab8-929b-8ee04a18c368" }] } } }
Status Code
204 - No Content