Skip to content

Commit 951528f

Browse files
authored
Create Incident_creation.js
Creation of incident
1 parent 6f7f610 commit 951528f

File tree

1 file changed

+15
-0
lines changed

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+
// This script can be used in a Script Include or Business Rule
2+
var incidentGR = new GlideRecord('incident');
3+
incidentGR.initialize();
4+
5+
incidentGR.short_description = 'Critical Incident - Immediate Attention Required';
6+
incidentGR.description = 'This is a Priority 1 incident created via script.';
7+
incidentGR.priority = 1; // Priority 1
8+
incidentGR.impact = 1; // High impact
9+
incidentGR.urgency = 1; // High urgency
10+
incidentGR.caller_id = gs.getUserID(); // Sets the current user as the caller
11+
incidentGR.category = 'network'; // Example category
12+
13+
// Insert the new record into the database
14+
var newIncidentID = incidentGR.insert();
15+
gs.info('New Incident created with ID: ' + newIncidentID);

0 commit comments

Comments
 (0)