Skip to content

Commit a220813

Browse files
code_snippet.js
1 parent b80e4fc commit a220813

File tree

1 file changed

+16
-0
lines changed
  • Server-Side Components/Business Rules/Cascade Priority Change from Parent to Child Incidents

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Below script automatically updates the priority of all child incidents whenever the parent incident’s priority is modified.
2+
(function executeRule(current, previous /*null when async*/ ) {
3+
4+
if (current.priority != previous.priority) {
5+
var childInc = new GlideRecord('incident');
6+
childInc.addQuery('parent_incident', current.sys_id);
7+
childInc.query();
8+
9+
while (childInc.next()) {
10+
childInc.impact = current.impact;
11+
childInc.urgency = current.urgency;
12+
childInc.work_notes = 'Priority updated automatically from parent incident ' + current.number;
13+
childInc.update();
14+
}
15+
}
16+
})(current, previous);

0 commit comments

Comments
 (0)