
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2020 12:23 PM
We would like to show the estimated wait time in virtual agent when user tries to connect with a live chat representative from the topics.
We've noticed that the estimated wait time is shown when trying to connect to live chat from the 3 dot menu. Can this feature be replicated within the transfer to live agent topic?
Transferring to live chat by selecting a topic does not show the estimated wait time. It would be nice to let the user know how long is the wait so that if it takes more than 30 secs they do not think it is a system glitch:
Transferring to live chat from the 3 dot menu does show the estimated wait time. Can this be done similarly when transferring to live chat from the list of topics?:
Thank you!
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 10:04 PM
Hi Yasmin,
Before Orlando you can write the following script.
var gt_avg_wt = new GlideRecord('awa_queue')
gt_avg_wt.addQuery('name','XYZ');//XYZ- is name of your queue
gt_avg_wt.query();
if(gt_avg_wt.next()){
var ftch_avg_wt = gt_avg_wt.average_wait_time;
var gdtTime = new GlideDateTime(ftch_avg_wt);
var num_ftch_avg_wt = gdtTime.getNumericValue();
var result;
var totalSec = num_ftch_avg_wt / 1000;
//gs.info('sec' + totalSec);
var hours = parseInt( totalSec / 3600 ) % 24;
//gs.info('hrs' + hours);
var minutes = parseInt( totalSec / 60 ) % 60;
//gs.info('minutes' + minutes);
var seconds = totalSec % 60;
//gs.info('seconds' + seconds);
if(hours == 0 & minutes != 0){
var result = (minutes < 10 ? "0" + minutes : minutes ) + " " + "minutes" + (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
//gs.info(result1);
}
else if(hours == 0 & minutes == 0 ){
var result = (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
}
else{
var result = (hours < 10 ? "0" + hours : hours) + " " + (minutes < 10 ? "0" + minutes : minutes +" "+ "Minutes") + " " + (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
// gs.info('result'+result);
}
vaVars.a = result;
}
Please mark this comment as Correct Answer/Helpful it it helped you.
Cheers,
Hardit Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 10:04 PM
Hi Yasmin,
Before Orlando you can write the following script.
var gt_avg_wt = new GlideRecord('awa_queue')
gt_avg_wt.addQuery('name','XYZ');//XYZ- is name of your queue
gt_avg_wt.query();
if(gt_avg_wt.next()){
var ftch_avg_wt = gt_avg_wt.average_wait_time;
var gdtTime = new GlideDateTime(ftch_avg_wt);
var num_ftch_avg_wt = gdtTime.getNumericValue();
var result;
var totalSec = num_ftch_avg_wt / 1000;
//gs.info('sec' + totalSec);
var hours = parseInt( totalSec / 3600 ) % 24;
//gs.info('hrs' + hours);
var minutes = parseInt( totalSec / 60 ) % 60;
//gs.info('minutes' + minutes);
var seconds = totalSec % 60;
//gs.info('seconds' + seconds);
if(hours == 0 & minutes != 0){
var result = (minutes < 10 ? "0" + minutes : minutes ) + " " + "minutes" + (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
//gs.info(result1);
}
else if(hours == 0 & minutes == 0 ){
var result = (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
}
else{
var result = (hours < 10 ? "0" + hours : hours) + " " + (minutes < 10 ? "0" + minutes : minutes +" "+ "Minutes") + " " + (seconds < 10 ? "0" + seconds : seconds +" " +"Seconds");
// gs.info('result'+result);
}
vaVars.a = result;
}
Please mark this comment as Correct Answer/Helpful it it helped you.
Cheers,
Hardit Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 06:42 AM
Thanks will git it a try and share any results.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2020 04:35 PM
It worked like magic! Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 07:23 AM
Hi
I have the same requirement
where we need to place this script to show expected time in Virtual agent chat.
Regards,
Venkat Kuruva