Live agent transfer to desired group agents.

Naveen_DK
Tera Expert

Hi Everyone,

 

I'm trying to transfer the Chat to Live agent based on user needs. If the user wants technical support the chat should get transferred to "Technical support" Group agents or if user wants subscription/non-technical support then the chat should get transferred to "Subscription Support" group agents.

 

I've done the below configurations:

 

1. Created 2 separate User groups "VA Technical Support" , "VA Subscription Support".

2. Added users to both the Groups and have given roles to users individually - tried with giving role to "Group" as well but didnt work.

3. Created 2 Queues in AWA - "Technical Support" and "Subscription Support"

Naveen_DK_1-1715842538152.png

 

Naveen_DK_2-1715842564907.png

 

4. Created Service Channel - "Technical Chat"

Naveen_DK_0-1715842480838.png

5. Created Assignment Eligibility for both Queues.

Naveen_DK_3-1715842642698.png

 

Naveen_DK_4-1715842665841.png

 

5. Created a Topic flow for agent chat using Designer.

Naveen_DK_5-1715842735506.png

 

Naveen_DK_6-1715842766919.png

 

6. Added Script action Utility with below script for both Technical support and Subscription support

 

(function execute() {
vaVars.LiveAgent_queue ='Technical Support'; // (Tried vaVars.LiveAgent_queue ='technical';
vaSystem.connectToAgent();
})()
 
 
(function execute() {
vaVars.LiveAgent_queue ='Subscription Support'; // (Tried vaVars.LiveAgent_queue ='subscription';
vaSystem.connectToAgent();
})()

 

7. Result is not as expected : Its not connecting to agent instead giving the end message from Agent Chat setting.

 

Naveen_DK_7-1715843081757.png

 

Kindly help me with routing the chat to desired Queue agents.

 

 

 

1 ACCEPTED SOLUTION

Naveen_DK
Tera Expert

Hey Chris,

 

Thanks for extending your support.

I've found the issue and fixed it, now its connecting to desired Queue agents.

"vaSystem.isLiveAgentAvailable()" didnt work for me thus removed this part and updated the script as below;

 

gs.info('entered Technical script execution');
(function execute() {
gs.info('entered Technical execute function');
vaVars.LiveAgent_queue=vaInputs.select_queue;
gs.info('queue selected'+vaInputs.select_queue);
vaSystem.connectToAgent();
gs.info('Connected to agent');
})()
 
Then updated the Queue as:
Naveen_DK_0-1715870273910.png

 

 

I'll be creating a document and post as article soon.

 

View solution in original post

4 REPLIES 4

Chris D
Mega Sage
Mega Sage

That setup looks pretty good to me...
(I'll just note there's nothing wrong with giving the role - awa_agent to be clear - to the group. In fact that's a better practice than giving to individuals but for the sake of testing, no need to dwell on it.)

 

The one thing you don't have described here is the "agent"... if you're not familiar with AWA, it will not transfer a chat unless an agent is Available and has capacity and I see no indication here that is the case.

In a separate session (private browser, etc.), impersonate one of your awa_agent users in (one of) your chat queue(s), open Service Operations Workspace/Agent Workspace, mark yourself Available (for chats), THEN test your topic.

Naveen_DK
Tera Expert

Hello Chris,

 

I've Opened Agent workspace with one of the user having awa_agent role and aslo part of my technical group, still its not connected to live agent.

 

To debug my script I've added logs, I can see that

vaSystem.connectToAgent(); is not working. Attaching test execution and logs.
Naveen_DK_0-1715867552647.png

 

Script used:

 

gs.info('Enter script Action');
(function execute() {
gs.info('entered execute function');
vaVars.LiveAgent_queue = 'Technical';
gs.info('Queue selected'+ vaInputs.select_queue);
if(vaSystem.isLiveAgentAvailable()){
gs.info("Agent is available");
vaSystem.connectToAgent();
}
gs.info('exit from agentAvailable');
})()
 
 
Agent is available in Microsft edge browser:
Naveen_DK_1-1715867656068.png

 

Users in group:

Naveen_DK_2-1715867704776.png

 

 

AWA Queue:

 

Naveen_DK_3-1715867751792.png

 

Naveen_DK
Tera Expert

Hey Chris,

 

Thanks for extending your support.

I've found the issue and fixed it, now its connecting to desired Queue agents.

"vaSystem.isLiveAgentAvailable()" didnt work for me thus removed this part and updated the script as below;

 

gs.info('entered Technical script execution');
(function execute() {
gs.info('entered Technical execute function');
vaVars.LiveAgent_queue=vaInputs.select_queue;
gs.info('queue selected'+vaInputs.select_queue);
vaSystem.connectToAgent();
gs.info('Connected to agent');
})()
 
Then updated the Queue as:
Naveen_DK_0-1715870273910.png

 

 

I'll be creating a document and post as article soon.

 

Not sure what the issue was with vaSystem.isLiveAgentAvailable() - I know it does still work (I used it in an if() statement today in our custom Transfer to Live Agent topic block) and I confirmed it's still officially support per the documentation: Virtual Agent scripts (servicenow.com)

 

Are you sure that was the issue? From your screenshot, it looks like you changed three things at the same time - proper debugging should have you change one at a time to determine the root cause...

 

As I mentioned elsewhere, we use the condition "Context.queue IS ___" because (imo) there's no reason not to if that queue name is hardcoded in the script - though I see no reason "Context.queue CONTAINS" shouldn't work...

 

And fwiw, we use the ootb "Chat" AWA Channel so I can't say I've ever experimented with a custom chat channel like you previously had in your setup. Similarly, I don't see why that wouldn't work, but, as above, unless you have a very specific and arguably niche need for it, it makes sense to just stick to the ootb Chat channel.