Conditional dropdown field sample. Conditions based on tags. (Web portal)

Zendesk note: If you are using Help Center, please use this code for conditional fields in Help Center.

Let's see how we can create a conditional dropdown field.

Initial case.
1. You have a two groups of custumers organizations. Enterprise organizations tagged by "enterprise". Small organizations tagged by "small"

  1. You have a dropdown field "Type of service" with items
    a. Ticket support (tagged as "ticket_support")
    b. Request for change (tagged as "request_for_change")
    c. Personal consultation (tagged as "personal_consultation")
    d. Fix bug in place (tagged as "in_place")

  2. And you want to hide c. and d. items from dropdown for organization tagged by "small"

It's not so hard to do as you can think =)

To make it create a Custom HTML widget with next code. And place it to the new ticket page.
NOTE: You should change 21126486 in code to ID of your field.

<script type="text/javascript" charset="utf-8">

Event.observe(document, 'widgets:load', function () {

new Ajax.Request('/users/current.json', {
method: 'GET', asynchronous: true, onSuccess: function (transport) {
var obj = transport.responseText.evalJSON();
org_id = obj['organization_id'];

new Ajax.Request('/organizations/' + org_id + '.json', {
method: 'GET', asynchronous: true, onSuccess: function (transport) {
var obj = transport.responseText.evalJSON();
tags = obj['current_tags'];

// ***** Check the tag "small" *****
if (tags.search("small") >= 0) {
// Remove two items from dropdown
$j("#ticket_fields_21126486 option[value='personal_consultation']").remove();
$j("#ticket_fields_21126486 option[value='in_place']").remove();




  • 0

    Hi Mikhail,

    This is a really useful function for our company.  But do you have an updated version that will work for the new Zendesk?




  • 0


    We do have a conditional fields for the new Zendesk but that is only agent facing. Mikhails' still will work for customer facing web portal if that is all you need.  

  • 0

    Hi Daniel,

    Thanks to Skip. That's right. This widget for customers portal.  

  • 0

    Hi,  I'm a little confused.  We have been told that "the new ticket page" is for the old Zendesk and we should not add widgets to the page.


    redirects to


    And if we add items there, they did work for the agent, but not the end user as it's an old Zendesk page.

    Also we have an app and javascript widget in place for conditional fields, which we now have working for both the agent and customer. (Selection on the main field causes three new fields to appear - using Skips conditional_fields app - which we now have working with wildcards as well)

    Whereas this code provided by Mikhail hides items within a field based on tags which is what we want for our customers portal.


  • 0

    Hi, I don't think end users have permission to run new Ajax.Request('/users/current.json.

  • 0

    If you are using the new Help Center the conditional fields code has changed which can be found here  https://github.com/skipjac/Zendesk-Apps/tree/master/conditional-fields-help-center

  • 0

    I've implemented on my Zendesk. Can you confirm that this app needs to be installed by every agent in order to work?

  • 0

    Brandon, Apps are global. Like our other apps, you should only have to install them on your site (not have every agent install them individually). 

Please sign in to leave a comment.