Real-time widget for longest wait time for connect support queue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 02:25 PM
I have a requirement from the Service Desk TL to get a real time widget to show the longest wait time for chat. I couldn't see anything out of the box in the PA chat plugin.
The only way I could get close to achieve this was to create another column on the chat_queue_entry table, then setup a schedule job to update that column with the current wait time for any chats in the 'waiting' status. This worked for calculating the duration, but didn't play nice with the real time score. It would start off by showing the longest wait time, but would show a 0 after the schedule job did the update.
Has anyone come across this as a requirement and have any ideas? Is there anything that I may have missed?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 12:03 AM
Make a field(max wait time) in chat_queue table.
Run a BR on chat_queue_entry on update.
Set condition when wait time changes & write below code-
var gr= new GlideRecord('chat_queue_entry');
gr.addQuery('queue',your_queue);
gr.orderByDesc('wait_time');
gr.setLimit(1);
gr.query();
if(gr.next()){
c=gr.wait_time;
}
In variable 'c' you will get the maximum wait time corresponding to a defined queue & you can set it to max wait time field in chat_queue table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2018 01:57 PM
Thanks for your response, but from what I can see the wait time field is calculated after the status comes out of 'Waiting'.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 02:06 AM
Yes, it shows wait time when chat status goes from waiting to other state. Wait time will be empty on waiting status. This is the out of the box functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2018 12:59 PM
Sorry I should have mentioned that I require the longest wait time while the chat is in a 'Waiting' state.
To add a bit more context, the service desk only has a couple of staff on chat, if it gets busy we want the other team members to be aware of how long the other chats have been waiting. If it gets past a certain time threshold, they'll jump on to help out.