Once Parent Incident Status Changes, Child Ticket Status Should Change automatically for all the states
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2022 03:06 AM
Hello All,
We are getting a conflict in our current scenario as whenever the Parent Incident Status changes to OnHold and On-hold reason is any one of the reasons from the drop-down, the corresponding Child Incident Status is not getting automatically changed to OnHold. Because of this, the SLA is getting breached in our Child Incidents which is very critical.
Can anyone let me know how to fix this asap?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 05:33 AM
Not required. Check the code and Mark my answer as correct
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 06:01 AM
Hello Musab,
Still its not working?? Even I changed the Parent Incident State to OnHold and Onhold Reason as Awaiting Caller, Child Incidents states are still in InProgress.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 06:58 AM
Ok got the issue now, please check the working code, Mark my answer as correct after validation. Please note there is OOB script which is making this change when on hold reason is not Awaiting caller hence you need script only for this condition ok.
Script :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addInfoMessage("Working fine");
var incident = new GlideRecord('incident');
incident.addQuery('parent_incident', current.sys_id);
// incident.addQuery('state', '3');
// incident.addQuery('hold_reason', '1');
incident.query();
while(incident.next()){
gs.addInfoMessage("Working fine fine");
incident.state = current.state;
incident.hold_reason = current.hold_reason;
incident.update();
}
})(current, previous);
Condition:
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 03:47 AM
Hello Musab,
Excellent!!! It worked for me finally...The Script has been executed and pop-up the info message as well, I have one more doubt here like again if I change the State from On-Hold to InProgress for Parent Incident the Child Incident stays as it is in OnHold State.
Can you please help me here as well for this scenario?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 04:17 AM
Don't you have this OOB business rule in your instance.? this is working well for me
https://yourinstance/sys_script.do?sys_id=eb8fa5b00b3332001604628393673a96&sysparm_view=&sysparm_record_target=sys_script&sysparm_record_row=2&sysparm_record_list=collection%3Dincident%5EORcollectionINincident%2Ctask%5EORDERBYDESCsys_updated_on&sysparm_record_rows=70
Regards,
Musab