Live agent routing for AWA queue with Virtual Agent


Description

The Live Agent variables like application, queue, short_description can be used within the Virtual agent Topic as per the following document "Virtual Agent scripts".

Where the Queue variable is supposed to be used only for "connect support" queue (chat_queue), it is not supported with AWA queue (awa_queue). Using awa_queue on the LiveAgent_queue variable might work at time, but it might fails other times.

 

This article briefs on how to decide the queue dynamically for AWA queue without using the sunsupported queue variable.

Release or Environment

Any release which supports AWA

Instructions

 

 

    1. Set condition mode as "Simple"
    2. Select "Context" in the condition
    3. Then select "Show related fields"
    4. Then select "Context=> Interaction related fields"
    5. Finally lookup for the variable you have created
(function executeCondition(/* glide record */ current) {  
 var contextTable = current.getValue('context_table');
 var interactionBlobRecord = new GlideRecord(contextTable);
 interactionBlobRecord.addQuery('sys_id',current.getValue('context_document'));
 interactionBlobRecord.query();

 if(interactionBlobRecord.next()){
  var jsonBlob = JSON.parse(interactionBlobRecord.getValue('value'));
  if(jsonBlob.liveagent_route == 'test')
   return true;
 }
 return false;
})(current);

Here the liveagent_route is the newly created context variable and it checks for the string "test" and if yes then routes it to the queue, else doesn't route it to the current queue.