boostn

BR - Outage Record

May 25th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function executeRule(current, previous /*null when async*/) {
  2.     var ci_array =[];
  3.     var recordId = current.sys_id;
  4.    
  5.     //Get List of Affected CI's and push to ARRAY
  6.     var gr1 = new GlideRecord("task_ci");
  7.     gr1.addQuery("task", current.sys_id); //current.incident
  8.     gr1.query();
  9.     while (gr1.next()) {
  10.         ci_array.push(gr1.ci_item.sys_id.toString());
  11.     }
  12.     //Script Include
  13.     var otl = new OutageRecord();
  14.     otl.createOutagefn(current.priority.toString(),ci_array,recordId);
  15.    
  16. })(current, previous);
Add Comment
Please, Sign In to add comment