User Activity

How to Cancel Child Incidents if parent incident gets cancelled?Please help with script.