whenever parent is closed, child should also close automatically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
How to do this in flow design.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
May you try vi Business Rule
- Table: the table where parent/child exists (e.g., incident)
- When: after
- Condition: when the parent state changes to Closed
- advanced checked
- script:
(function executeRule(current, previous /*null when async*/) {
// Run only if the parent is moved to "Closed"
if (current.state.changesTo('7')) { // '7' = Closed in Incident table, adjust for your table
// Query child records
var childGR = new GlideRecord('incident'); // replace with your table if different
childGR.addQuery('parent_incident', current.sys_id); // adjust field name
childGR.addQuery('state', '!=', '7'); // only those not already closed
childGR.query();
while (childGR.next()) {
childGR.state = current.state; // set same state as parent
childGR.close_code = current.close_code; // optional, copy close reason
childGR.close_notes = 'Closed automatically when parent was closed.';
childGR.update();
}
}
})(current, previous);
this is an example, but you can ajust for you scenario
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
No I need to do this in flow design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Above explained in flow designer.
Do want to do in workflow or flow designer ?
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @ShivaK548811677 ,
Choose the "Update Record".
Add condition: state changes to Closed (e.g., state becomes Closed or equivalent closed state value).
Use the "Look Up Records" action.
Select the child table (records you want to close automatically).
Add a condition linking child to the parent. For example, parent field (reference) equals current record’s sys_id.
Add a "For Each" loop action, iterating through the child records found.
Inside this loop, add an "Update Record" action.
Update the child record’s state field to Closed (or equivalent).
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!