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
}

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

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

See Also

Migration REST API