How can a custom ticket field be hidden by using the Zendesk Apps framework (ZAF)?

Question

How can a custom ticket field be hidden with the Zendesk Apps framework?

Answer

You can implement a sidebar app to hide custom ticket fields by using the ticketField.hide command as described in the documentation.

To use custom fields, replace the identifier portion zafClient.invoke('ticketFields:identifier.hide') with custom_field_{ID}

The correct syntax to hide a field is zafClient.invoke('ticketFields:custom_field_{ID}.hide')

To retrieve the exact identifier, use the .name command  zafClient.get('ticketFields:custom_field_{ID}.name')

For example, for the custom field name For API 3:

The syntax to get the custom field name is zafClient.get('ticketFields:custom_field_14399631996699.name')

Below is an example response using the v2 REPL app:

The syntax to hide the custom field is zafClient.invoke('ticketFields:custom_field_14399631996699.hide')

Below is an example response using the v2 REPL app:

For more information, see the articles:

ZAF Client API

Ticket and New Ticket sidebar

Test drive the Apps framework

Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Post any issues you have in the comments section or try searching for a solution online.