Skip to content

Commit fd3dbf9

Browse files
authored
Create P1 Incident
This script automates the creation of a **Priority 1 (P1)** Incident in ServiceNow. It is useful for testing, automation, or simulating critical incident scenarios.
1 parent f9a60bc commit fd3dbf9

File tree

1 file changed

+15
-0
lines changed
  • Server-Side Components/Background Scripts/Create P1 Incident

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function() {
2+
var incidentGR = new GlideRecord('incident');
3+
incidentGR.initialize();
4+
incidentGR.short_description = 'Critical system outage';
5+
incidentGR.description = 'All users are unable to access the core application. Immediate attention required.';
6+
incidentGR.impact = 1; // High
7+
incidentGR.urgency = 1; // High
8+
incidentGR.priority = 1; // P1
9+
incidentGR.category = 'network'; // Example category
10+
incidentGR.assignment_group = 'NETWORK_SUPPORT'; // Replace with actual group sys_id or name
11+
incidentGR.caller_id = gs.getUserID(); // Current user
12+
incidentGR.insert();
13+
14+
gs.info('P1 Incident created: ' + incidentGR.number);
15+
})();

0 commit comments

Comments
 (0)