Guest User

Untitled

a guest
Feb 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. var s = new GlideRecord('sysauto_script');
  2. s.initialize();
  3.  
  4. s.cmdb_ci = current.u_config_item;
  5.  
  6. s.name = current.u_subcategory.getDisplayValue();
  7.  
  8.  
  9. s.run_type = current.u_run.getDisplayValue();
  10.  
  11.  
  12. s.run_time = current.u_hours;
  13.  
  14. s.run_dayofweek = current.u_day;
  15.  
  16. s.run_dayofmonth = current.u_select_day.getDisplayValue();
  17.  
  18. s.run_period = current.u_repeat_interval;
  19.  
  20. s.script = "(function () {var scheduled_task = new GlideRecord('u_scheduled_task'); scheduled_task.initialize(); scheduled_task.cmdb_ci = current.u_config_item; scheduled_task.short_description = current.u_desc; scheduled_task.description = current.u_description; scheduled_task.assigned_to = current.u_assigned_to; scheduled_task.state = current.u_state; scheduled_task.insert(); })();";
  21.  
  22. s.insert();
Add Comment
Please, Sign In to add comment