Skip to content

Commit 9645c64

Browse files
Hactober fest 2025 (3rd pull request) (#2511)
* code_snippet.js * README.md * Add files via upload * code_snippet.js * README.md
1 parent 50feef6 commit 9645c64

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This code_snippet.js script automatically updates the priority of all child incidents whenever the parent incident’s priority is modified.
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)