Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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”
Original file line number Diff line number Diff line change
@@ -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'
};
Loading