Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Adds the Change Request numbers to the work notes of incidents that have the same CI.
Operates on the Incident table as a Before Business Rule.

Excludes CRs that are closed and cancelled.
Helps agents to quickly identify related changes during incident triage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(function executeRule(current, previous /*null when async*/) {

if(current.cmdb_ci){
var ci = current.cmdb_ci.getValue();

var chng = new GlideRecord('change_request');
chng.addQuery('cmdb_ci', ci);
chng.addQuery('state', '!=', '3');
chng.addQuery('state', '!=', '4');
chng.query();

var work_notes = '';

while(chng.next()){
work_notes += chng.getValue('number') + '\n';
}

if(work_notes){
current.work_notes = 'Following change requests are associated with the same CI. You can attach one of them.\n' + work_notes;
}

}

})(current, previous);
Loading