Skip to content

Commit a82940e

Browse files
authored
Create Incident creation
The script uses the GlideRecord API to interact with the incident table and inserts a new record with the specified values.
1 parent abbe375 commit a82940e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This script can be used in a Script Include or Business Rule
2+
var incidentGR = new GlideRecord('incident');
3+
incidentGR.initialize();
4+
incidentGR.short_description = 'Critical Incident - Immediate Attention Required';
5+
incidentGR.description = 'This is a Priority 1 incident created via script.';
6+
incidentGR.priority = 1; // Priority 1
7+
incidentGR.impact = 1; // High impact
8+
incidentGR.urgency = 1; // High urgency
9+
incidentGR.caller_id = gs.getUserID(); // Sets the current user as the caller
10+
incidentGR.category = 'network'; // Example category
11+
incidentGR.insert();

0 commit comments

Comments
 (0)