Time out for Unanswered Live Chat

Hailee Moffitt
Kilo Contributor

Hi,

We just enabled the Virtual/Live agent to our instance.  One of the problems we are seeing with the Live Agent is if an end user initiates a Live Agent chat and it is not picked up, it does not time out. For example, our Live Chat is open from 7am-6pm.  If a user initiated the live chat at 5:53pm and one of my colleagues is unable to answer it, the chat does not close out at 6pm and it shows as a person waiting in the queue until the next morning when someone logs in.  This in turn makes our "wait time" look like it is 15 hours long, and of course the user is no longer there. I know there is a timeout of 6 minutes once a chat is picked up by an ITIL user, but is there a way to do the following:

1) Have a timeout set to end a live chat request if an ITIL user does not pick it up?

2) Have a message before that timeout to ask the end user if they still want to wait or be directed to put in a ticket instead?

Also, I have a question about the Live Chat.  If an end user initiates the Live Chat but is unable to reach anyone and doesn't close the chat request, does the chat not time out with the user's session time out or them logging out of the instance?  Some examples being if their login session times out on the website or the close the mobile window on their phone.  I would like to make the note that this is if the Live Chat is not picked up. 

Thanks!

Hailee

4 REPLIES 4

trevorn
Tera Contributor

Hi Hailee, 

I believe you can find what you're looking for regarding timeouts in this community post. 

https://community.servicenow.com/community?id=community_article&sys_id=1453b03bdbaad0109e691ea668961929


Muralidharan BS
Mega Sage
Mega Sage

Hi Hailee,

I had the same issue but unfortunately there is no OOB solution to control the time the user  wait in the queue and abandon the conversation. 

But there is a custom way which I have implemented may help you, Create a flow or schedule job to run at 6:10 PM or so. Make the chat which are "in progress and waiting" and make them abandoned. You have to consider two tables to abandon the conversation - [sys_cs_conversation and chat_queue_entry]. This will solve your first question.

2. No we cannot insert a message when user is showing "routing to live agent". 

On the user's session time, we have OOB setting only when user is conversing before connecting to live agent and after connecting to live agent. But I don't find any such settings to control the wait time.

Also there is OOB scheduled job [question 1] which does the job of abandoning the chat_queue_entry but not the conversation, may be you can leverage that too - Connect Support Idle Conversation Cleanup

 

Thanks

 

Hi Murali,

Would you mind sharing the script you used to create this scheduled job?  I am not well-versed in writing scripts yet, only editing. 

I think this would solve my problem, so thank you!

Hailee

Hi Hailee,

Here is the script, you can use this in scheduled job to run at 6.30 or so. Or you can create a script include and call the functions in the scheduled job.

Please test this in lower environment and use in prod. Also check the encoded query and tweak as required.

var chatqueue = new GlideRecord('chat_queue_entry');
chatqueue.addEncodedQuery('state=1^sys_created_onRELATIVELT@minute@ago@30');
chatqueue.query();
while (chatqueue.next()) {
chatqueue.action = 'abandoned';
chatqueue.state = 8; //closed abandoned
chatqueue.active = false;
chatqueue.update();

var convqueue = new GlideRecord('sys_cs_conversation');
        var convqu = 'state=chatInProgress^live_agent_transfer_timeRELATIVELT@minute@ago@60^consumer.user_id=' + chatqueue.opened_by;
        convqueue.addEncodedQuery(convqu);
        convqueue.query();
        if (convqueue.next()) {
            var convtask = new GlideRecord('sys_cs_conversation_task');
            convtask.addQuery('conversation', convqueue.sys_id);
            convtask.addEncodedQuery('state=gatherData');
            convtask.query();
            if (convtask.next()) {
                convtask.state = 'faulted';
                convtask.update();
            }
            convqueue.state = 'faulted';
            convqueue.update();
        }
}


 

Thanks