want to chamge teh state in child Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2024 09:51 PM
When I add the parent incident to the related records of the child incident
then the child incident state should become the same as the parent incident.
Can you please help to create this in Client Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 08:14 PM
Hi @aggarwaltan ,
create Business rule on incident table when to run before update
add condition like below !current.parent.nil() && current.parent.changes();
and advance script will be
(function executeRule(current, previous /*null when async*/) {
if (!current.parent.nil() && current.parent.changes()) {
var parentIncident = new GlideRecord('incident');
if (parentIncident.get(current.parent)) {
current.state = parentIncident.state; // Set child state to parent state
}
}
})(current, previous);
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 11:27 PM
Please read the documentation on state syncing between parent and child incidents before adding in additional customization.