From a075f587ad733911464991d793823dab1f44ffa0 Mon Sep 17 00:00:00 2001 From: Ravi Gaurav Date: Tue, 14 Oct 2025 16:17:57 +0530 Subject: [PATCH 1/3] Create incident.js Automatically detect the root cause category of an Incident based on keywords in the short description or description. --- .../Root-Cause Predictor/incident.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Server-Side Components/Script Includes/Root-Cause Predictor/incident.js diff --git a/Server-Side Components/Script Includes/Root-Cause Predictor/incident.js b/Server-Side Components/Script Includes/Root-Cause Predictor/incident.js new file mode 100644 index 0000000000..e6a8e8324d --- /dev/null +++ b/Server-Side Components/Script Includes/Root-Cause Predictor/incident.js @@ -0,0 +1,22 @@ +//Scenario : Automatically detect the root cause category of an Incident based on keywords in the short description or description. + +// Script Include +var RootCausePredictor = Class.create(); +RootCausePredictor.prototype = { + predict: function(text) { + var data = { + network: ['router', 'switch', 'wifi', 'dns'], + hardware: ['laptop', 'keyboard', 'printer', 'battery'], + application: ['login', 'error', 'bug', 'page'], + security: ['virus', 'attack', 'unauthorized'] + }; + text = text.toLowerCase(); + for (var cat in data) { + for (var i = 0; i < data[cat].length; i++) { + if (text.includes(data[cat][i])) return cat; + } + } + return 'general'; + }, + type: 'RootCausePredictor' +}; From e1409c21dd9304a8cdc061777b482f0d21267877 Mon Sep 17 00:00:00 2001 From: Ravi Gaurav Date: Tue, 14 Oct 2025 16:21:53 +0530 Subject: [PATCH 2/3] Create README.md This Readme contains info on what is there on Script Include. Automatically detect the probable root cause (Network, Hardware, Application, Security, etc.) based on ticket description keywords. --- .../Root-Cause Predictor/README.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Server-Side Components/Script Includes/Root-Cause Predictor/README.md diff --git a/Server-Side Components/Script Includes/Root-Cause Predictor/README.md b/Server-Side Components/Script Includes/Root-Cause Predictor/README.md new file mode 100644 index 0000000000..c3da49d8aa --- /dev/null +++ b/Server-Side Components/Script Includes/Root-Cause Predictor/README.md @@ -0,0 +1,35 @@ +## Incident Root-Cause Predictor + +### Overview +The **Incident Root-Cause Predictor** automatically classifies incoming Incidents into categories like *Network, Hardware, Application,* or *Security* based on keywords in the description. +This helps in faster triaging and routing tickets to the right support teams. + +--- + +## How It Works +1. A user submits an Incident. +2. A **Business Rule** runs on insert. +3. It calls the **Script Include – `RootCausePredictor`**. +4. The predictor scans the description and returns a probable root-cause category. + +--- +## Business Rule Script (How to call Script Include on BR) + var util = new global.RootCausePredictor(); + +(function executeRule(current) { + var util = new global.RootCausePredictor(); + var cat = util.predict(current.description); + current.u_root_cause = cat; + current.work_notes = "🔍 Auto-classified as: " + cat.toUpperCase(); +})(current); + +-------------- +## Sample Input and Output +Input : A user logs a ticket: +“Wi-Fi keeps disconnecting every few minutes.” + +The Script Include scans for the word “Wi-Fi”, which matches the Network keyword list. +OutPut: + +System automatically sets field u_root_cause = "Network" +Work note added: “Auto-classified as: NETWORK” From c2d8a00675895ae1ef576cf712db25f72ae9e040 Mon Sep 17 00:00:00 2001 From: Ravi Gaurav Date: Tue, 14 Oct 2025 16:22:19 +0530 Subject: [PATCH 3/3] Update README.md Automatically detect the probable root cause (Network, Hardware, Application, Security, etc.) based on ticket description keywords. --- .../Script Includes/Root-Cause Predictor/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server-Side Components/Script Includes/Root-Cause Predictor/README.md b/Server-Side Components/Script Includes/Root-Cause Predictor/README.md index c3da49d8aa..71e22242b4 100644 --- a/Server-Side Components/Script Includes/Root-Cause Predictor/README.md +++ b/Server-Side Components/Script Includes/Root-Cause Predictor/README.md @@ -20,7 +20,7 @@ This helps in faster triaging and routing tickets to the right support teams. var util = new global.RootCausePredictor(); var cat = util.predict(current.description); current.u_root_cause = cat; - current.work_notes = "🔍 Auto-classified as: " + cat.toUpperCase(); + current.work_notes = "Auto-classified as: " + cat.toUpperCase(); })(current); --------------