Skip to content

Commit 29cf78e

Browse files
Create business rule.js
1 parent ca3fe0e commit 29cf78e

File tree

1 file changed

+15
-0
lines changed
  • Server-Side Components/Business Rules/Incident Root Cause Suggestion

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function executeRule(current, previous /*null when async*/) {
2+
3+
// Only run if short_description or description changes
4+
if (current.short_description.changes() || current.description.changes()) {
5+
6+
var helper = new IncidentRootCauseHelper();
7+
var suggestions = helper.getRootCauseSuggestions(current.short_description + " " + current.description);
8+
9+
if (suggestions.length > 0) {
10+
// Store suggestions in a custom field (multi-line text)
11+
current.u_root_cause_suggestions = suggestions.join("\n");
12+
}
13+
}
14+
15+
})(current, previous);

0 commit comments

Comments
 (0)