Create a Custom Field

Use the following operation to create a custom field in Zephyr Enterprise:

POST /flex/services/rest/latest/project

Request format

To create a custom field, send a POST request to the following URL:

http://{ZEPHYR-SERVER}/flex/services/rest/latest/field

Request body

{ "entityName": "testcase", "systemField": false, "displayName": "Text customfield2", "fieldTypeMetadata": 1, "mandatory": false, "importable": true, "exportable": true, "searchable": true, "searchFieldName": "textcf2", "projectCheck": true, "unique": false, "length": 1024, "allProject": true, "isVisible": true }
  • The entityName value can be testcase, requirement, or project.

  • The fieldTypeMetaData value can be any of the following:
    1 - text
    2 - long text
    3 - picklist
    4 - check box
    5 - date
    10 - number
    12 - cascade
    13 - rich text

Response body

{ "id": 1006, "entityName": "testcase", "systemField": false, "fieldTypeMetadata": 1, "fieldName": "zcf_1006", "columnName": "zcf_1006", "displayName": "Text customfield2", "mandatory": false, "searchable": true, "importable": true, "exportable": true, "length": 1024, "searchFieldName": "textcf2", "createdOn": 1588072804836, "projectIds": [], "unique": false, "allProject": true, "isVisible": true }

Specify values for the custom field

Use the following operation:

PUT /flex/services/rest/v3/admin/preference

Request format

To specify a value for a custom field, send a PUT request to the following URL:

http://{ZEPHYR-SERVER}/flex/services/rest/v3/admin/preference

Request body

{ "value": "[{\"value\":\"option 1\",\"id\":\"1\"},{\"value\":\"option 2\",\"id\":\"2\"}]", "accessLevel": 0, "defaultValue": "[{\"value\":\"option 1\",\"id\":\"1\"},{\"value\":\"option 2\",\"id\":\"2\"}]", "editable": true, "isCustomizable": true, "name": "testcase.zcf_1008.LOV" }

testcase.zcf_1008.Lov is the field name of the created picklist custom field appended with the entity name.

Response body

See Also

Migration REST API