Skip to content

Commit db73580

Browse files
authored
Create Update Priority
This script updates all Priority 1 (P1) incidents to Priority 3 (P3) in ServiceNow. It is useful for bulk downgrading incident priority based on revised impact or urgency assessments
1 parent f9a60bc commit db73580

File tree

1 file changed

+17
-0
lines changed
  • Server-Side Components/Background Scripts/Lower down the incident Priorit

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
var gr = new GlideRecord('incident');
3+
gr.addQuery('priority', 1); // P1 incidents
4+
gr.query();
5+
6+
var count = 0;
7+
while (gr.next()) {
8+
gr.impact = 2; // Medium
9+
gr.urgency = 2; // Medium
10+
gr.priority = 3; // P3
11+
gr.update();
12+
gs.info('Updated Incident to P3: ' + gr.number);
13+
count++;
14+
}
15+
16+
gs.info('Total P1 Incidents Updated to P3: ' + count);
17+

0 commit comments

Comments
 (0)