- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
17 hours ago
we have a requirement, when the incident or request is closed, automatically the interaction record needs to close. Already we have a Ui button in SOW interaction form, when we click the button in the interaction form, the incident or request will create. here in incident the associated interaction record is updating in the work notes. now the client wants additional changes which i mentioned in the first line. how can we achieve, please help with the process and the script.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
HI @suryaogeti1 ,
1.The configuration should be like this , add filter conditions as per requirement
2.Script:
(function executeRule(current, previous /*null when async*/) {
var gr=new GlideRecord("interaction_related_record");
gr.addQuery("document_table","sc_request"); //updated table name
gr.addQuery("document_id",current.sys_id);
gr.query();
if(gr.next())
{
var interaction=new GlideRecord("interaction");
if(interaction.get(gr.getValue("interaction")))
{
interaction.state="closed_complete";
interaction.update();
}
}
})(current, previous);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
it's a configuration available in SOW
for REQ see if that works, if not then write after update BR and query "interaction_related_record" and search and close Interaction
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Hi @Ankur Bawiskar
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3m ago
So what worked for you since you marked response as correct?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
