File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Server-Side Components/Business Rules/Cascade Priority Change from Parent to Child Incidents Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ This code_snippet.js script automatically updates the priority of all child incidents whenever the parent incident’s priority is modified.
Original file line number Diff line number Diff line change 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 ) ;
You can’t perform that action at this time.
0 commit comments