How to transfer a chat to a specific Queue using c... - ServiceNow Community
SandilyaSridhar
ServiceNow Employee
ServiceNow Employee
  • This article talks about a specific use case of transferring a chat to a specific queue using context variables.
  • This functionality can be achieved in several ways and this article demonstrates this by making use of VA-Designer.
  • If VA-Designer(com.glide.cs.chatbot) is not installed, the same can be achieved by making use of the pre-chat survey(FYI).

Firstly what are contextual variables:

  • The variables that contain contextual information can be used to determine topic intent or control how chats are routed to live agents.
  • You can also define variables to capture contextual information passed in Virtual Agent topic scripts to share with the live agent.
  • To find where the context variables are defined, Open the 'chat setup' record and the 'contexts' are added as a related list to it as shown below.
  • find_real_file.png

Now that we understand what are the context variables, Let's make use of them to achieve the functionality of routing to a specific queue.

Step1:

  • Create a topic and add a static 'Choice component ' that defines the number of queues based on the requirement.
  • In the below example, I have created two queues for example: 
  1. Queue1:Agent Chat
  2. Queue2: Agent queue 2

find_real_file.png

  • Create the script actions to make use of the context variables to map the respective queues based on the work item routing condition provided in the Queue.
  • The below images showcases the script used in the script action snippets.

find_real_file.pngfind_real_file.png

  • The context variable used is the 'vaVars.LiveAgent_queue' that defines the queue to be routed.
  • For example:
  • (function execute() {
        
    vaVars.LiveAgent_queue = 'Agentqueue2';
    if(vaSystem.isLiveAgentAvailable()){
    vaSystem.connectToAgent();
    }
    })()

     

Step2:

  • Configure the Service channel and the queue. 
  • On the queue, let's look into the details in using the context variables on the 'work item routing condition'
  • find_real_file.pngfind_real_file.png
  • find_real_file.png
  • find_real_file.png
  • By following the above steps, We have achieved dot walking the queue variable from the contexts.
  • Once the queue variable is dot walked on the routing condition, Map the queue with one of the choices that were created in the topic . 
  • For example:  Context.queue - contains - Agentqueue2
  • find_real_file.png
  • Make sure the topic that was created is published and activated. And once the above configuration is done, now the chats will be routed to the specific queue as defined above.

 

Do share your thoughts on the same.

Happy learning.

Comments
Chris D
Kilo Sage
Kilo Sage

Great job documenting this.

It's a super basic use case but for some reason made incredibly complex in setting up and hadn't really been well documented that I recall seeing so this will definitely help some new VA admins.

SandilyaSridhar
ServiceNow Employee
ServiceNow Employee

Thank you chris for your inspiring compliments.

Ashley
Kilo Sage

Good Afternoon,

This is what I have been looking for but it doesn't seem to work for me, as the context field doesn't get set until after the agent has accepted the chat when the interaction record is created.

Did you need to make any more changes for it to work?

Kind Regards

Ashley

VISWANATH KAMAL
Tera Contributor

@SandilyaSridhar 

 

Do we need to add any value to the context?

Naveen_DK
Tera Expert

I've defined two queues Technical support and Subscription support. I've followed your steps but its not connecting to the agents. Displaying final message "Sorry for the inconvenience caused!
There are no agents available at the moment. Please try again later."

Kindly help me to connect to live agent of particular group based on user input - select queue "technical" or "subscription".

Version history
Last update:
‎01-17-2022 10:13 PM
Updated by: