Debug the virtual agent topic

abc_001
Tera Contributor

I have a requirement to mark the interactions closed abandoned instead of closed complete. For that I duplicated the Closing Conversation and created a new custom topic in virtual agent designer. In that I setup a script to mark it close abandoned. But its not working and logs are not showing up. I have pasted the script here for refence:

(function execute() {
//vaSystem.endConversation();
gs.info("end convo1 test");
var data= vaSystem.getConversationId();
gs.info("end convo = "+data);
var gr=new GlideRecord('interaction');
gr.addQuery('sys_id',data);
gr.query();
if(gr.next()){
gr.state=closed_abandoned;
gr.update();
}
})()
 
How I can link this duplicated topic to current chat agent. 
 
Quick response are appreciated.  
1 REPLY 1

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @abc_001 ,

 

Instead of creating a new script try to amend the existing script with a IF conditon on what to mark closed complete or closed incomplete...

 

 use if else condition under > if(gr.next()){.........}

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect