- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
How to recognize whether an interaction record is created by Virtual Agent Live Agent?
We see if the record in interaction table is created by virtual agent chatbot, the record assigned to is virtual agent, however if it's created by Live Agent, don't know how to recognize it. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI @Lisa71 ,
The Virtual Agent column in the interaction record will be set to true.A Virtual Agent conversation is flagged when a requester selects a conversation topic or when the topic discovery process starts the appropriate conversation.
if the interaction record is created by a live agent, Virtual Agent column
The Agent chat Flag that indicates the conversation was transferred to a live agent in Agent Chat: true or false.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
// Replace this sys_id with the Interaction record you want to check
var gr = new GlideRecord('interaction');
gr.addQuery('sys_id', 'PUT_INTERACTION_SYS_ID_HERE'); // change this manually each time
gr.query();
if (gr.next()) {
var assignedTo = gr.assigned_to.getDisplayValue();
var channel = gr.channel.getDisplayValue();
var source = gr.source.getDisplayValue();
gs.info('Assigned To: ' + assignedTo);
gs.info('Channel: ' + channel);
gs.info('Source: ' + source);
if (assignedTo == 'Virtual Agent' || source == 'Virtual Agent' || channel == 'Chatbot') {
gs.info(' Interaction created by Virtual Agent');
} else {
gs.info('Interaction created by Live Agent');
}
}
The script should be run in Background Scripts for testing. Just replace the sys_id in the query with the Interaction record you want to check. The script will print out the Assigned To, Channel, and Source values in the logs.
If Assigned To = Virtual Agent or Source = Virtual Agent or Channel = Chatbot, then the record was created by Virtual Agent.
Otherwise, it was created by a Live Agent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
// Replace this sys_id with the Interaction record you want to check
var gr = new GlideRecord('interaction');
gr.addQuery('sys_id', 'PUT_INTERACTION_SYS_ID_HERE'); // 👈 change this manually each time
gr.query();
if (gr.next()) {
var assignedTo = gr.assigned_to.getDisplayValue();
var channel = gr.channel.getDisplayValue();
var source = gr.source.getDisplayValue();
gs.info('Assigned To: ' + assignedTo);
gs.info('Channel: ' + channel);
gs.info('Source: ' + source);
if (assignedTo == 'Virtual Agent' || source == 'Virtual Agent' || channel == 'Chatbot') {
gs.info(' Interaction created by Virtual Agent');
} else {
gs.info('Interaction created by Live Agent');
}
}
The script should be run in Background Scripts for testing. Just replace the sys_id in the query with the Interaction record you want to check. The script will print out the Assigned To, Channel, and Source values in the logs.
If Assigned To = Virtual Agent or Source = Virtual Agent or Channel = Chatbot, then the record was created by Virtual Agent.
Otherwise, it was created by a Live Agent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
// Replace this sys_id with the Interaction record you want to check
var gr = new GlideRecord('interaction');
gr.addQuery('sys_id', 'PUT_INTERACTION_SYS_ID_HERE'); // 👈 change this manually
gr.query();
if (gr.next()) {
var assignedTo = gr.assigned_to.getDisplayValue();
var channel = gr.channel.getDisplayValue();
var source = gr.source.getDisplayValue();
gs.info('Assigned To: ' + assignedTo);
gs.info('Channel: ' + channel);
gs.info('Source: ' + source);
if (assignedTo == 'Virtual Agent' || source == 'Virtual Agent' || channel == 'Chatbot') {
gs.info('✅ Interaction created by Virtual Agent');
} else {
gs.info('👤 Interaction created by Live Agent');
}
}
The script should be run in Background Scripts for testing. Just replace the sys_id in the query with the Interaction record you want to check. The script will print out the Assigned To, Channel, and Source values in the logs.
If Assigned To = Virtual Agent or Source = Virtual Agent or Channel = Chatbot, then the record was created by Virtual Agent.
Otherwise, it was created by a Live Agent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
HI @Lisa71 ,
The Virtual Agent column in the interaction record will be set to true.A Virtual Agent conversation is flagged when a requester selects a conversation topic or when the topic discovery process starts the appropriate conversation.
if the interaction record is created by a live agent, Virtual Agent column
The Agent chat Flag that indicates the conversation was transferred to a live agent in Agent Chat: true or false.
Thanks,
BK