It is no longer required to create date variables from individual jobs as they are automatically created by Agents at task start:

JS-429 - Getting issue details... STATUS

FEATURE AVAILABILITY STARTING FROM RELEASE 1.12

 


  • If you want to use date values in order paramters then you could add an initial job to the begin of your job chain. 

  • This job would calculate some date variables as hour, month or year and set the order parameters accordingly.

Configuration for Initialization Job

 

 

 

 

 

Source for Initialization Job

Initialization Job
 <job  order="yes" stop_on_error="no">
     <script  language="java:JavaScript">
         <![CDATA[
 function spooler_process()
 {
    var today = new Date();
 
    var month = today.getMonth()+1; 
    var fullYear = today.getFullYear(); 
    var day = today.getDate();
    var dayOfWeek = today.getDay();   
    var hour = today.getHours();
    var minutes = today.getMinutes();
    var seconds = today.getSeconds();
 
    var lastMonthDate = new Date();
    lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
    var lastMonth = lastMonthDate.getMonth()+1; 
    var lastFullYear = lastMonthDate.getFullYear(); 
    var lastDay = lastMonthDate.getDate();
    var lastDayOfWeek = lastMonthDate.getDay();   
 
    var order = spooler_task.order;
 
    order.params.set_var("month",month);
    order.params.set_var("fullYear",fullYear);
    order.params.set_var("day",day);
    order.params.set_var("dayOfWeek",dayOfWeek);
    order.params.set_var("hour",hour);
    order.params.set_var("minutes",minutes);
    order.params.set_var("seconds",seconds);
 
    order.params.set_var("lastMonth",lastMonth);
    order.params.set_var("lastFullYear",lastFullYear);
    order.params.set_var("day",day);
    order.params.set_var("dayOfWeek",dayOfWeek);
    order.params.set_var("lastDay",lastDay);
    order.params.set_var("lastDayOfWeek",lastDayOfWeek);
  
 	return true;
 }
         ]]>
     </script>

     <run_time />
 </job>

Related Downloads