Skip to content

Commit 13ddd26

Browse files
After_BR.js
1 parent 06c5594 commit 13ddd26

File tree

1 file changed

+18
-0
lines changed
  • Server-Side Components/Business Rules/Auto create Problem when P1 Incident created

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
function executeRule(current, previous /*null when async*/ ) {
2+
if (current.priority == 1 && current.operation() == 'insert') {
3+
var problemGR = new GlideRecord('problem');
4+
problemGR.initialize();
5+
problemGR.short_description = current.short_description;
6+
problemGR.description = current.description;
7+
problemGR.cmdb_ci = current.cmbi_ci;
8+
9+
var problemID = problemGR.insert();
10+
11+
if (problemID) {
12+
current.problem-id = problemID;
13+
current.update();
14+
}
15+
}
16+
})(current, previous);
17+
18+

0 commit comments

Comments
 (0)