Help mapping Interaction from REQ down to sc_task

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey all,
In our system, REQs are mapped to Interactions. For some reason, on certain records only the REQ itself is mapped — the related RITMs and sc_tasks don’t get it.
I was able to figure out how to link the REQ’s Interaction to all of its child RITMs, and that works fine. Now I’m trying to do the same for the sc_task records under those RITMs, but my Flow keeps running into errors.
The goal:
Target all sc_task records whose parent REQ has an Interaction
Map that same Interaction onto the sc_task
Has anyone else run into this or built something similar? Does my approach sound off, or would you recommend a different way of handling it?
Screenshots of my Flow and error messages are attached for reference.
Thanks in advance for any ideas!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Andrew Meza
May you try those option to solve your issue
A)
After your “Update RITMs with Interaction” step, add:
Get Related Records → Table sc_task, condition request_item = current RITM.sys_id.
For Each → loop those tasks.
Update Record → set Interaction field = Interaction from the REQ.
Watch out: if you’re processing a REQ with 100s of tasks, the Flow can become heavy.
B)
This is often cleaner and more performant than Flow if you need it to happen consistently:
(function executeRule(current, previous /*null*/) {
// Business Rule on sc_req_item (after update, when Interaction changes)
if (current.interaction.changesToNotEmpty()) {
var taskGr = new GlideRecord('sc_task');
taskGr.addQuery('request_item', current.sys_id);
taskGr.query();
while (taskGr.next()) {
taskGr.interaction = current.interaction;
taskGr.update();
}
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
will this BR you provided go back and find all the records that need to be fixed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks for posting this.