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

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

is there a way for this to work on the UI form instead of just the agent workspace?

Hello, I implemented your BR, and it worked great, but I am having an issue with clicking on the "info" icon for the user profile and that action is closing the interaction. It should only close if it is transferred to a REQ, INC, or CHG. Would you happen to know why?

Harneet Sital
Mega Sage
Mega Sage

Hi Rajesh,

Can you please mark the answer as helpful and correct if the above has resolved your query?


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