Create Incident When Live Agent Rejects or Not Accept the chat in Virtual Agent

Hardeep Singh
Tera Contributor

There is a requirement to create incident whenever user is trying to connect to live agent. If there is no agent present, we can create incident easily but if agent is present and not accepting or rejecting the chat then there should be incident created and visible in card of virtual agent.

 

Can anyone help in this?

3 REPLIES 3

Lynda1
Kilo Sage

This is actually an interesting concept!

I am going to see if I can do this in the transfer to live agent topic block and let you know.

Bharath38
Tera Guru

We have implemented this, you can update Transfer to Live agent topic as below and create an Incident

 

Bharath38_0-1737667234505.png

 

Lynda1
Kilo Sage

If your incidents are 100% OOTB, Barath's answer can be used. Our Incidents are far from OOTB so this took some doing!

This is the code in the first component of the OOTB Create Incident.

(function execute() {
var caller = vaInputs.caller;
var short_desc = vaInputs.short_description;
var urgency = vaInputs.urgency;
var desc = vaInputs.description;
var cmdb_ci = vaInputs.cmdb_ci;

if (!gs.nil(caller) && !gs.nil(short_desc)) {
var incDetails = new sn_itsm_va.VACreateINCUtil().createIncident(caller, short_desc, urgency, desc, cmdb_ci);
vaVars.inc_sysid = incDetails.sysid;
}
 
})()
 
I looked at what our incident requires. In a new Topic Block, I created a chat flow, looking up the available values from our incident, present to the user to select, creating new variables to pass to the copied Create Incident Topic Block so it now looks like this.
 
(function execute() {
var caller = vaInputs.caller;
var symptom = vaInputs.symptom;
var desc = vaInputs.description;
var cmdb_ci = vaInputs.cmdb_ci;
var short_desc = "Issue with " + vaInputs.cmdb_ci;

if (!gs.nil(caller) && !gs.nil(short_desc)) {
var incDetails = new sn_itsm_va.VACreateINCUtil().createIncident(caller, symptom, short_desc, desc, cmdb_ci);
vaVars.inc_sysid = incDetails.sysid;
}
 
})()
 
The hardest part was figuring out how to gather the information from the user using the incident template we have. This is doable, takes a lot of effort.  I hope this makes sense!