How to recognize whether an interaction record is created by Virtual Agent Live Agent?

Lisa71
Tera Expert

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. 

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron

HI @Lisa71 ,

 

The Virtual Agent column in the interaction record will be set to true.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.

 

For more information 

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK

View solution in original post

5 REPLIES 5

srisaisats
Kilo Contributor

// 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.

 

srisaisats
Kilo Contributor

// 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.

srisaisats
Kilo Contributor

// 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.

Bhavya11
Kilo Patron

HI @Lisa71 ,

 

The Virtual Agent column in the interaction record will be set to true.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.

 

For more information 

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK