Forums/Community/Community tips & tricks

"Time in state" widget (Zendesk Classic)

Vincent Brendel
posted this on August 05, 2009 17:54

If you would like to know how long a ticket has for example spent in the Pending state, add this widget to your agent's ticket view.

This Custom HTML widget will use the ticket's audit trail to work out how much time was spent in each state. Here's a sample of what you will see:

Open: 10h 34m so far
Pending: 9m
Solved: 52m

One of the states will say 'so far' to highlight that it is the active state.

Please provide some feedback if this was useful to you.

 

Comments

User photo
Landon
officeautopilot

This is sweeet.. can someone explain how to install this?  Can't figure it out... help!

 

August 14, 2009 14:53
User photo
Vincent Brendel
panviva
  • In your Zendesk account, go to: Accounts > Widgets

The Visible Widgets screen displays.

  • Click on Add widget

The Select a widget to add screen displays.

  • Scroll down and select Custom widget

Fill in the fields in the form:

  1. Custom widget title: Time in state
  2. Availability: Agents
  3. Content: using eg. notepad, copy & paste the HTML code from the attachment above (time-in-state-widget.html)

 

  • Next to the Submit button, select Create widget
  • Click Submit

Your widget has now been created. To add it to the tickets pages, as a Zendesk account owner/admin you have the option to do this from the page itself.

August 14, 2009 16:59
User photo
Landon
officeautopilot

Yeah, but it only seems to work on unassigned tickets... otherwise just says "loading..".

August 14, 2009 17:12
User photo
Vincent Brendel

I only have a free version of Zendesk which is single user... for the cases where it doesn't work, if you can show me the HTML code I might be able to fix it.

1. Go to: http://YOUR ZENDESK ACCOUNT.zendesk.com/tickets/TICKET NUMBER/events?filter=audits&format=html

2. Do a "Save as..." or View Source and copy the html, then send to vb @ nerdburger dot net.

August 14, 2009 17:30
User photo
Landon
officeautopilot

Actually.. it works for agents.. not admins.. good enough!  Love it!

August 14, 2009 17:30
User photo
Fredrik Cederman
expressenit

This sounds great and just what we are looking for. But I cant get to work. Onlys says loading…

October 06, 2009 04:36
User photo
Aron Bert

Interesting issue.  My time in state widget has a ticket that was opened at 8:10 PM PST and it stated that it has been open for 9 hours.?.?

November 04, 2009 22:08
User photo
Vincent Brendel

Hi Aron, it may be because timezones. The widget compares timezones from the server with the current time on the client side. You are obviously using PST in your Zendesk, the browser you are using may have a different timezone set? It's just a guess... either way it should only skew the time on the current state, not the other states the ticket has been in. Cheers, Vincent

November 04, 2009 22:14
User photo
Aron Bert

Its just odd that only the tickets that were created after Sunday which is when we rolled clocks back that the time in state stopped working.  The one today shows the ticket has been open for 12 hours 55 Min when it was only opened at 12:20 today and it is only 1:15 right now..?

November 05, 2009 13:15
User photo
Ophir Ronen
cascadeo

I get an error message:  Result of expression 'matches' [null]

Any ideas? This is a useful widget.

January 15, 2010 05:13
User photo
Ophir Ronen
cascadeo

specifically:

 

Exception:
TypeError: Result of expression 'matches' [null] is not an object.
Exception:
TypeError: Result of expression 'matches' [null] is not an object.

January 15, 2010 05:48
User photo
Miguel Zavala
hayes

Doesn't seem to be working, the time portion seems to be accurate but the status portion settings don't seem to match the tickets ie: an open tickets shows

new: 10h 34m so far

instead of

open:10h 34m so far. 

February 03, 2010 11:06
User photo
Sandrine Moreau
primatics

the attachement with the html code says Loading....

I can't get the code.. do you know where to find it?

Thanks!

February 04, 2010 11:12
User photo
Sandrine Moreau
primatics

found it, thanks

February 04, 2010 11:14
User photo
Miguel Zavala
hayes

If you right click the file saved and open it with notepad you should be able to open it.

 

Miguel 

February 04, 2010 11:15
User photo
Luke Healey

Has anyone worked out why this widget will only display 'Loading....'?? - this widget would be most helpful for my zendesk implementation, but I have no idea how to troubleshoot it..

February 14, 2011 13:46
User photo
Vincent Brendel

Hi Luke, the way this is implemented is probably not ideal, it relies on the dates on the ticket page being displayed a specific way. Zendesk has also changed some stuff on the ticket page since this widget was created. I can have another look at it at some point. If your organization can benefit from customizations such as this one, feel free to contact me with your ideas: vincent@brendel.net.au.

February 14, 2011 14:36
User photo
Luke Healey

cheers for that Vincent... will have a chat with the team and decide whether it is worth investigating further.

February 14, 2011 16:00