Criar Campo Personalizado
Last modified: June 10, 2022
To create or update a custom field, use the /rest/1/custom-field
endpoint. You must provide params parameter.
Request Parameters
params
: (Required) To create a custom field, specify name, type and other parameters of the field. To update a custom field, add its ID to the parameters.
Create Text Custom Field Example
{ "customName":"Text Some Custom Field Name", "type":"textfield", "defaultText":"Some Default Text", "canBeLoaded":"false", "visibleEmpty":"true" }
Create Dropdown Custom Field Example
{ "customName":"Some drop Custom Field Name", "type":"dropdown", "defaultText":"Some Default Text", "canBeLoaded":"false", "visibleEmpty":"false", "dropdownquery":"line1;line2;line3" }
Create Picker Custom Field Example
{ "customName":"Some picker1", "type":"picker", "defaultText":"Some Default Text", "canBeLoaded":"false", "visibleEmpty":"true", "isInlineEditable": "false", "multiple":"true", "pickerquery":"type:term" }
Update Text Custom Field Example
{ "id": "t1822651913", "customName":"Text Some Custom Field Name", "type":"textfield", "defaultText":"Some Default Text", "canBeLoaded":"false", "visibleEmpty":"true" }
Curl Request
curl -X POST "http://localhost:8080/rest/1/custom-field" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"customName\":\"Text Some Custom Field Name\",\"type\":\"textfield\",\"defaultText\":\"Some Default Text\",\"canBeLoaded\":\"false\",\"visibleEmpty\":\"true\"}"
Server Response Example
Response Body
{ "data": "t270475346", "isSuccess": true }
Response Headers
cache-control: no-cache, no-store, max-age=0, must-revalidate connection: Keep-Alive content-length: 38 content-type: application/json;charset=ISO-8859-1 date: Fri, 21 Aug 2020 08:25:10 GMT expires: 0 keep-alive: timeout=5, max=100 pragma: no-cache server: Apache/2.4.10 (Debian) x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 1; mode=block