5

Highlight ticket in view if it has a defined tag. Widget. (Zendesk Classic)

For example. You need to highlight a tickets if they marked by tag "enterprise"

  1. Create Custom HTML Widget

  2. Past next code

<p>Highlighting.</p>
<script type="text/javascript" charset="utf-8">
Event.observe(document, 'widgets:load', function()
{
$j(document).ready(function()
{
// For each row in view
$j('.tickets td.nice_id').each(function()
{
t=$j(this).text();
var cell=$j(this);

// Get ticket
new Ajax.Request('/tickets/'+t+'.json',
{
method:'GET',asynchronous: true,onSuccess: function(transport)
{
var obj = transport.responseText.evalJSON();
// Get tags
tags = obj['current_tags'];
// ***** Check tag "enterprise" *****
if (tags.search("enterprise")>=0)
{
// highlight
$(cell).css('background-color','orange');
};
}
});
});
});
});
</script>

  1. Place widget to your view page.

NB. View must contain an ID field

19 comments

Please sign in to leave a comment.
Help them find what they're looking for
Create an online destination for 24/7 support with Zendesk
TRY IT FOR FREE