Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
19 changes: 19 additions & 0 deletions DepartmentFilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var getSameDeptUsers = Class.create();
getSameDeptUsers.prototype = {
initialize: function() {},
getSameDept: function() {
var user = gs.getUser().getDepartmentID();
var d = new GlideRecord('sys_user');
d.addQuery('department', user);
d.query();

var str = "";
while (d.next()) {
str = str + "," + d.sys_id;
}
return 'sys_idIN' + str;

},

type: 'getSameDeptUsers'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

(function executeRule(current, previous /*null when async*/) {

// Add your code here
if(current.category == 'hardware'){
var gr=new GlideRecord('problem');
gr.initialize();
gr.short_description=current.short_description;
gr.category=current.category;
gr.impact=current.impact;
gr.urgency=current.urgency;
gr.insert();

}
})(current, previous);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This script is a ServiceNow Business Rule that automatically creates a Problem record whenever an Incident is created with the category set to "hardware".
It helps in ensuring that hardware-related incidents are tracked and analyzed properly through Problem Management.
Loading