Skip to main content
Skip table of contents

Zendesk custom JavaScript code

You can use custom JavaScript code to modify the received ticket JSON object before importing a ticket into Click Add custom JavaScript code to show the code editor.

You can use ticket variable to access received Zendesk REST API ticket JSON object properties and modify or add additional properties. You can see the ticket JSON and test your custom JavaScript code by entering the ticket number and clicking Show.

Here is an example of JavaScript code that will clear the ticket subject property if the ticket tags include a "secret" tag:

if (ticket.tags && ticket.tags.indexOf("secret") >= 0) {
  ticket.subject = "";

If you would like to skip some tickets and do not import them in then use return false; in these cases.

Please contact support if you need help to write custom JavaScript code for your specific needs.

See more on available Javascript functions

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.