interaction to be automatically closed when it gets attached to a TASK, INC or RITM

rajesh29
Tera Expert

Hello Everyone,

I have an Requirement in Agent Workspace. we would like for the interaction to be automatically closed when it gets attached to a TASK, INC or RITM.

Thanks in advance.

Rajesh B.

1 ACCEPTED SOLUTION

Harneet Sital
Mega Sage
Mega Sage

Hi Rajesh, 

Create a new BR on the 'interaction_related_record' record with the table conditions if you want or simply a BR with the following script will close interaction as soon as a record is created from the interaction. (you have mentioned TASK Table, incident and Requested item table would be extended from TASK so the below BR without any condition should work for you)

 

(function executeRule(current, previous /*null when async*/ ) {

    var closeInteractionRec = new GlideRecord('interaction');
    closeInteractionRec.get(current.interaction.sys_id);
    closeInteractionRec.state = 'closed_complete';
    closeInteractionRec.update();

})(current, previous);

find_real_file.png

 


Thanks

-Harneet Sital (ServiceNow Certified Technical Architect)
Request you to please mark my answer as helpful or correct based on the impact
Find all my ServiceNow articles here

View solution in original post

5 REPLIES 5

Thank you @Harneet Sital 

it's working as expected. Once again Thank you!