- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 01:00 PM
I have a requirement to sync child incidents (assigned to filed) to parent incident. so every time, I update 'assigned to' in parent incident.
I wrote this below, NOT WORKING. Any help ?
Async,
Update,
condition: Assigned to changes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2023 12:28 PM
Found out the issue, I was looking at the wrong table .
I made BR changes to extended table and looking for Child incidents on Incident table. That's the mistake I made. This should be good.
Thanks for looking in to it. @Bert_c1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 02:38 PM
You could try something like this:
(function executeRule(current, previous /*null when async*/ ) {
var parentInc = current.sys_id;
var childIncs = new GlideRecord('incident');
childIncs.addQuery();
childIncs.addActiveQuery("parent_incident", parentInc);
childIncs.query();
while (childIncs.next()) {
childIncs.assignment_group = current.assignment_group;
childIncs.assigned_to = current.assigned_to;
childINcs.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 07:42 AM
Not working, I'm doing this on a extended incident table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 03:16 PM
Hi R Charan C,
I tested your script, and got expected results. Assigned to and assignment group changed on the incidents with 'parent_incident' to what was set on the "parent" incident. I don't understand why yours doesn't work. Maybe try the above suggested changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 07:43 AM
Not working. Is this because we have extended table and the script is on extended incident table ?