Zendesk: hide the name of submitter and date in forum article
The Problem
It’s a request we have quite often so, even though it’s a one line of code, I thought it might be useful to share this!
If you don’t want your name to be tied to a forum article, you can create a fake Zendesk user just to post articles.
Another easy way is to use this bit of code to remove entirely the date and the forum submitter name.
An article will look like this:

Create a Global JavaScript widget and put in there the following code.
The code
$j(".entry-container p.entry_user").hide();
It’s available on my GitHub.
TweetZendesk: hide ticket fields based on a user’s organisation
It’s cool to display ticket fields to agents and/or end users, but what if you have different organisations in the same Zendesk and want to hide specific fields only for people in a specific organisation? Well, say no more!
The requirement
In one of my Zendesk environment I have 3 organisations: organisation of customer 1, organisation of customer 2 and our internal organisation (our company). Whenever end users, agents or light agents from our company are checking a ticket, I want them to see a specific ticket field that contains an internal reference. If people from organisation of customer 1 or 2 are checking out the same ticket I don’t want them to see that internal reference.
The solution
Create a Global JavaScript extension in which you replace var organization_ids = [20863746] by the actual ID of the organisation that shouldn’t see the field (you can have the ID via Manage> People> Organisations) and replace id_to_remove = “#ticket_fields_20813026” by the unique ID of your custom field. Or even, by modifying the code a bit, simply put there the CSS ID of the field.
//START hide field based on organisation
jQuery(function($) {
var organization_ids = [22071016],
//Insert here the ID from the organisation which shouldn't see the field
id_to_remove = "#ticket_fields_20813026",
//Insert here the ID of custom field or the DIV ID of a system field you want to hide
user_url = jQuery("a#top-right-name").attr("href");
jQuery.getJSON(user_url, {}, function(data){
if (organization_ids.indexOf(data.organization_id) >= 0){
jQuery(id_to_remove).parent().remove()
}
})
})
//END hide field based on organisation
The result
This is the customer’s view. Hey, something disappeared!
The source
Available on my GitHub account
TweetZendesk: add color to priorities in Views
It’s a very, very minor addition but I tweaked our Zendesk CSS to show some colours next to each ticket’s priority level. I didn’t use the Zendesk score feature so I removed that column from the Views we have but I wanted to know, by having a quick glance, how many low, normal or urgent requests we had.
The solution
Except from priority_normal, each priority has its own CSS class. So I simply added to my custom CSS the following code to add some colors (obviously, blue is “relaaax” and red is “WTFBBQ!11!!”)
priority_urgent{
color:red;}
.priority_high{
color:orange;}
.priority_low{
color:blue;}
The result
The source
Available here.
TweetZendesk: change the default priority names
When we defined the Mondial Telecom SLA, we decided to use our own priority names instead of the usual high & normal ones. Don’t ask why
The Problem
There is no way to edit the default Zendesk priority names. Which makes sense since you can simply create custom fields and disable the default ones. However the issue I had with that is firstly the way GoodData handles custom field metrics. With a system drop down menu, in GoodData you have a neat report. Custom fields are supported but the way they are displayed in GoodData is less powerful.
The other issue is that we used our Zendesk for some time with the default priorities names. Changing suddenly in the middle of the process to custom drop down menus would have messed all that.
The solution
jQuery comes to help! With a tiny JS snippet (to enable via Manage> Extensions in your Zendesk) you can easily change the priority names in the ticket creation view and the tickets views. I skipped the macros & triggers for now. So now we have the best of both worlds: custom priority names & awesome metrics in GoodData reports.
Please note that it’s actually Skip Moore from Zendesk who published the code to change the names in the ticket creation view on his GitHub account.
The code
/* Original code from Skip Moore of Zendesk - https://github.com/skipjac/zendesk-widgets */
$j('#ticket_priority_id option[value=1]').text('G3');
$j('#ticket_priority_id option[value=2]').text('G2');
$j('#ticket_priority_id option[value=3]').text('G1');
$j('#ticket_priority_id option[value=4]').text('G0');
/* Added this to display the correct priority name in the Views */
/* Update 16082012 - added the class to avoid breaking your CSS customization */
$j('span.priority_normal').replaceWith('G2');
$j('span.priority_low').replaceWith('G3');
$j('span.priority_high').replaceWith('G1');
$j('span.priority_urgent').replaceWith('G0');
It’s available here.
TweetZendesk Enterprise: global satisfaction score
One of my biggest grief about the Enterprise plan of Zendesk is its lack of support for the satisfaction score. I mean, all accounts have their own satisfaction score like on a regular plan but we lack a way to have the global score of all branded spokes added to the one of the main hub.
I needed this. So I fixored this
. Plus, the following Python script will calculate your satisfaction score even if you have less than 100 satisfaction feedback on your account. And finally, I push the score to Ducksboard, a very cool real time dashboard in which you can see all your business metrics.
So basically, a simple Python scripts reads the account.zendesk.com/satisfaction.json file, counts the number of 0 (bad) and 1 (good) feedbacks. It does this for each of your accounts so you can add more than the 3 I have below. Then some simple maths are applied to make a sum of all good and back feedbacks and give you a result in percent.
You need to trigger this script via a cron tab, for example, so that every x hour the latest data from your Zendesk accounts will be read. And at that moment it will also shoot the results to the Ducksboard API (I just left the code there, simply delete this if you don’t need it).
My second grief about the Enterprise plan is that it lacks the support of placeholders throughout the spokes (for automated emails, like hello {{ticket_requester_name}} ), but that’s for another post
The script
#!/usr/bin/env python
"""Fetches the satisfaction score of Zendesk spokes and gathers it in one spot. You will need to call this script with a CRON so that it is launched every day, for example.
As a bonus, I left the code about Ducksboard. It's a cool system to display BI and monitoring stuff regarding your service. Simply replace the API_KEY and END_POINT values."""
__author__ = "Arnaud de Theux"
__web__ = "http://arnaud.detheux.org"
__twitter__ = "@AdeTheux"
from urllib import urlopen
import urllib
import sys
import os
###Below the 3 spokes we have at the moment, simply put your Zendesk account name
#spoke 1
good = 0
bad = 0
data = urlopen("http://SPOKE1.zendesk.com/satisfaction.json").readlines()[0]
good = data.count('1')
bad = data.count('0')
#spoke 2
good1 = 0
bad1 = 0
data = urlopen("http://SPOKE2.zendesk.com/satisfaction.json").readlines()[0]
good1 = data.count('1')
bad1 = data.count('0')
#spoke 3
good2 = 0
bad2 = 0
data = urlopen("http://SPOKE3.zendesk.com/satisfaction.json").readlines()[0]
good2 = data.count('1')
bad2 = data.count('0')
###Makes a simple addition
sum_good = good + good1 + good2
sum_bad = bad + bad1 + bad2
###You can now simply call sum_good and sum_bad to display it all over the interwebs.
###This is the code to push the values in bubbles in your Ducksboard account
command = "curl -u API_KEY:ignored -d '{\"value\": %d}' https://push.ducksboard.com/values/END_POINT/" % sum_good
command2 = "curl -u API_KEY:ignored -d '{\"value\": %d}' https://push.ducksboard.com/values/END_POINT/" % sum_bad
print command
os.system(command)
print command2
os.system(command2)
Demo
Well in this case there is not much to show
Either you just run the script and return the results wherever you want, or you push them to Ducksboard and it can look like this:
Code
The source code is available here.
Tweet





