Skip to content

Commit b0ff8ee

Browse files
Automatically Detect Incident Root Cause (#2139)
* Create incident.js Automatically detect the root cause category of an Incident based on keywords in the short description or description. * 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. * Update README.md Automatically detect the probable root cause (Network, Hardware, Application, Security, etc.) based on ticket description keywords.
1 parent 1a317da commit b0ff8ee

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Incident Root-Cause Predictor
2+
3+
### Overview
4+
The **Incident Root-Cause Predictor** automatically classifies incoming Incidents into categories like *Network, Hardware, Application,* or *Security* based on keywords in the description.
5+
This helps in faster triaging and routing tickets to the right support teams.
6+
7+
---
8+
9+
## How It Works
10+
1. A user submits an Incident.
11+
2. A **Business Rule** runs on insert.
12+
3. It calls the **Script Include – `RootCausePredictor`**.
13+
4. The predictor scans the description and returns a probable root-cause category.
14+
15+
---
16+
## Business Rule Script (How to call Script Include on BR)
17+
var util = new global.RootCausePredictor();
18+
19+
(function executeRule(current) {
20+
var util = new global.RootCausePredictor();
21+
var cat = util.predict(current.description);
22+
current.u_root_cause = cat;
23+
current.work_notes = "Auto-classified as: " + cat.toUpperCase();
24+
})(current);
25+
26+
--------------
27+
## Sample Input and Output
28+
Input : A user logs a ticket:
29+
“Wi-Fi keeps disconnecting every few minutes.”
30+
31+
The Script Include scans for the word “Wi-Fi”, which matches the Network keyword list.
32+
OutPut:
33+
34+
System automatically sets field u_root_cause = "Network"
35+
Work note added: “Auto-classified as: NETWORK”
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//Scenario : Automatically detect the root cause category of an Incident based on keywords in the short description or description.
2+
3+
// Script Include
4+
var RootCausePredictor = Class.create();
5+
RootCausePredictor.prototype = {
6+
predict: function(text) {
7+
var data = {
8+
network: ['router', 'switch', 'wifi', 'dns'],
9+
hardware: ['laptop', 'keyboard', 'printer', 'battery'],
10+
application: ['login', 'error', 'bug', 'page'],
11+
security: ['virus', 'attack', 'unauthorized']
12+
};
13+
text = text.toLowerCase();
14+
for (var cat in data) {
15+
for (var i = 0; i < data[cat].length; i++) {
16+
if (text.includes(data[cat][i])) return cat;
17+
}
18+
}
19+
return 'general';
20+
},
21+
type: 'RootCausePredictor'
22+
};

0 commit comments

Comments
 (0)