Question

I am using the latest Zendesk product. To test some javascript widgets I used the sandbox which took me to the old style Zendesk. I put together the following widget and it worked fine;

$j(document).ready(function() {            

   //Grabs the value from Time to Complete.
   var dec = $j('#ticket_fields_22215232').val();   

   //hm is an array where hm[0] is hours and hm[1] is mins.
   var hm = new Array();
   var hm =
   [
    (dec > 0) ? Math.floor(dec) : Math.ceil(dec),
    dec % 1
   ];

   //Stop user from being able to focus on field.
   $j('#ticket_fields_22251826').prop("disabled", true);

   //Converting the time to decimal.
   dec = hm[0]+Math.round(hm[1]*Math.pow(10,2))/60;

   //Places the new value into the hidden field. 
   jQuery('#ticket_fields_22251826').val(dec);

})

Basically it takes the value from one field, manipulates it, and places it in another field. This second field is disabled from editing.

I can't make anything work in the actual Zendesk. What are the differences?

Was it helpful?

Solution

Widgets created in Classic Zendesk only affect the end-user experience. If you're looking to carry over that same functionality to the agent side, you'd need to create the same experience as an app.

You can update your sandbox to New Zendesk by navigating to https://yoursandboxhere.zendesk.com/settings/new_zendesk and clicking Switch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top