TicketFields
Create, update, delete, and query TicketFields in Zendesk.
Table Specific Information
Select
The following queries are processed server side while other filters are processed client side within the driver.SELECT * FROM TicketFields SELECT * FROM TicketFields WHERE Id = '123'
You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any other search criteria will be ignored and an unfiltered response will be returned.
Insert
The Type and Title fields are required to insert. Allowed for admins.
INSERT INTO TicketFields(Type, Title) VALUES('text', 'Age')
To insert a ticket field of type tagger (dropdown) or multiselect (dropdown), CustomFieldOptions is also required. Allowed for admins.
INSERT INTO TicketFields(Type, Title,CustomFieldOptions) VALUES('tagger', 'TestDropdown','[{\"name\": \"Apple Pie\", \"value\": \"apple\"}, {\"name\": \"Pecan Pie\", \"value\": \"pecan\"}]')
To insert a ticket field of type regexp, RegexpForValidation is also required. Allowed for admins.
INSERT INTO TicketFields(Type, Title,RegexpForValidation) VALUES('regexp', 'TestRegExp','\\b([0-9]{4})-(1[0-2]|0?[1-9])-(3[0-1]|[1-2][0-9]|0?[1-9])\\b')
Update
You must specify the Id of the ticket field to update. All fields that are not readonly (readonly="false" in the table) are optional. Allowed for admins.
UPDATE TicketFields SET Title='Your age' WHERE Id='123'
For a ticket field of type tagger (dropdown) or multiselect (dropdown), use the CustomFieldOptions column to update the options. For type regexp use RegexpForValidation to update the regular expression.
Delete
You must specify the Id of the ticket field to delete it. Allowed for admins.
DELETE FROM TicketFields WHERE Id='123'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | Long | True |
Automatically assigned when the ticket is created. | |
Type | String | False |
The type of the ticket field: checkbox, date, decimal, integer, regexp, tagger, text, or textarea. Type is not editable once created. | |
Title | String | False |
The title of the ticket field. | |
RawTitle | String | False |
The dynamic content placeholder, if present, or the 'title' value, if not. | |
Description | String | False |
The description of the purpose of this ticket field, shown to users. | |
RawDescription | String | False |
The dynamic content placeholder, if present, or the 'description' value, if not. | |
Position | Integer | False |
A relative position for the ticket fields that determines the order of ticket fields on a ticket. Note that positions 0 to 7 are reserved for system fields. | |
Active | Boolean | False |
Whether this field is available. | |
Required | Boolean | False |
Whether this field is available. | |
CollapsedForAgents | Boolean | False |
If this field should be shown to agents by default or be hidden alongside infrequently used fields. Classic interface only. | |
RegexpForValidation | String | False |
Regular expression field only. The validation pattern for a field value to be deemed valid. | |
TitleInPortal | String | False |
The title of the ticket field when shown to end users. | |
RawTitleInPortal | String | False |
The dynamic content placeholder, if present, or the 'title_in_portal' value, if not. | |
VisibleInPortal | Boolean | False |
Whether this field is available to end users. | |
EditableInPortal | Boolean | False |
Whether this field is editable by end users. | |
Tag | String | False |
A tag value to set for checkbox fields when checked. | |
CreatedAt | Datetime | True |
The time the ticket field was created. | |
UpdatedAt | Datetime | True |
The time of the last update of the ticket field. | |
SystemFieldOptions | String | True |
Presented for a ticket field of type 'tickettype', 'priority' or 'status'. | |
CustomFieldOptions | String | False |
Required and presented for a ticket field of type 'tagger'. | |
Removable | Boolean | True |
If this field is not a system basic field that must be present for all tickets on the account. | |
Url | String | True |
The URL for this resource. |