From a82940e7b40e662478a0791b5a17adb05d769273 Mon Sep 17 00:00:00 2001 From: Thrizvi <145013431+Thrizvi@users.noreply.github.com> Date: Fri, 3 Oct 2025 12:56:04 +0530 Subject: [PATCH] Create Incident creation The script uses the GlideRecord API to interact with the incident table and inserts a new record with the specified values. --- .../Background Scripts/Incident creation | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Server-Side Components/Background Scripts/Incident creation diff --git a/Server-Side Components/Background Scripts/Incident creation b/Server-Side Components/Background Scripts/Incident creation new file mode 100644 index 0000000000..acd5f1b4c0 --- /dev/null +++ b/Server-Side Components/Background Scripts/Incident creation @@ -0,0 +1,11 @@ +// This script can be used in a Script Include or Business Rule +var incidentGR = new GlideRecord('incident'); +incidentGR.initialize(); +incidentGR.short_description = 'Critical Incident - Immediate Attention Required'; +incidentGR.description = 'This is a Priority 1 incident created via script.'; +incidentGR.priority = 1; // Priority 1 +incidentGR.impact = 1; // High impact +incidentGR.urgency = 1; // High urgency +incidentGR.caller_id = gs.getUserID(); // Sets the current user as the caller +incidentGR.category = 'network'; // Example category +incidentGR.insert();