Can an AI Agent Connect to Live Agent ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I am building an AI Agent in ServiceNow, and I would like to know if it is possible for this AI Agent to connect with users to a live agent when prompted. Specifically, I am looking for the following information:
- Can my AI Agent be configured to seamlessly connect to a live agent upon user request?
- If this is achievable, what are the steps or best practices to implement this functionality within ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
@HarshaSeetha In Your environment I assume you have - Now Assist for ServiceNow Virtual Agent Enabled?
In Your AI Agent You need to Write Proper Prompt (In what scenario you need Live Agent) and Tool (Script) for Same. Here is the URL which will guide you with Methods and Objects using which your script can connect to Live Agent.
- Check Agent Availability (Optional but Recommended):
- Use vaSystem.isLiveAgentAvailable() to see if agents are online before attempting a transfer.
- Example: (function execute() { vaVars.agentAvailable = vaSystem.isLiveAgentAvailable(); })()
- Set Routing (If Needed):
- Before connecting, set a context variable (e.g., LiveAgent_route) to direct the chat to a specific queue/group, often using a dynamic choice script for user selection.
- Example (in a previous step): vaVars.LiveAgent_route = vaInputs.liveChatQueues;.
- Connect to Agent:
- Call vaSystem.connectToAgent() in a 'Run Script' action.
- Example: (function execute() { vaSystem.connectToAgent(); })()
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @rpriyadarshy ,
In my environment the Now Assist for ServiceNow Virtual Agent Plugin is Enabled.
I have added the script as given, in the tools, when I test the AI Agent, its unable to connect to live agent, its throwing a reference error.
In the tool when I use the script which provided above its throwing a Reference Error at Line Number 4 in the below script
I have attached the output below
