Create a user-defined field

This topic provides instructions for using the POST operation to add a UDF (user-defined field).

Overview

To create a user-defined field, perform a POST, passing a JSON string.

To do this, add subtypes by performing a POST to the metadata subtypes: field_metadata_string and field_metadata_list.

Use this syntax to add user-defined fields for manual tests:

POST .../api/shared_spaces/1001/workspaces
{
 {"data":[
  {"subtype":"field_metadata_string","entity_type":"test_manual","name":"<udf_field_name>","label":"<Label_Name>"},
  {"subtype":"field_metadata_list","entity_type":"test_manual","name":"<udf_list_field_name>","label":"<Label_Name>","list":{"type":"list_node","id":"manual_test_priority_ln"}}
 ]
 }
}

Example

The following code shows the creation of two UDF fields: Zephyr ID and Priority.

POST .../api/shared_spaces/1001/workspaces
{
 {"data":[
  {"subtype":"field_metadata_string","entity_type":"test_manual","name":"zephyr_id_udf","label":"Zephyr ID"},
  {"subtype":"field_metadata_list","entity_type":"test_manual","name":"priority_udf","label":"Priority","list":{"type":"list_node","id":"manual_test_priority_ln"}}
 ]
 }
}

Back to top

See also: