Skip to content

Commit 55cae26

Browse files
Problem Creation (#1908)
* Create DepartmentFilter.js * Create CreateProblem.js * Create README.md * Delete DepartmentFilter.js * README.md
1 parent 5bdc638 commit 55cae26

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
(function executeRule(current, previous /*null when async*/) {
3+
4+
// Add your code here
5+
if(current.category == 'hardware'){
6+
var gr=new GlideRecord('problem');
7+
gr.initialize();
8+
gr.short_description=current.short_description;
9+
gr.category=current.category;
10+
gr.impact=current.impact;
11+
gr.urgency=current.urgency;
12+
gr.insert();
13+
14+
}
15+
})(current, previous);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This script is a ServiceNow Business Rule that creates a Problem record whenever an Incident is created with the category "hardware".
2+
3+
Note: Not every hardware-related incident requires a problem record — this script is just an example to show how such automation can be set up.

0 commit comments

Comments
 (0)