Add a Change Approval Based on Blackout Dates

Brad Kallmeyer1
Tera Guru

We have a need to add a VP for change approvals during blackout windows. We have played around with a script in the workflow but have not been able to get anything to work.

 

Wanted to see if anyone else has done anything like this an how you went about it.

3 REPLIES 3

Bhavesh Jain1
Giga Guru

Could you paste your script here so we can suggest modifications?




Regards,


Bhavesh


IGate-logo.png


http://www.igate.com


If your running conflict check and the tool finds a Blackout Window you will have a 'conflicts' related table populated against that change that will contain the 'conflict' information, if you add a script activity to check this table in the workflow , you will find the conflict and type-blackout and then add the approver in an approval activity.



There is also a conflict status field on the change itself that changes to 'conflict' but that doesn't contain the details of the conflict, only the related 'conflict' records will have that.



Marc


Little more information regarding the script, we are grabbing the Planned End Date from the change and doing a compare to the Blackout files, we are getting dates, but not formatted as you see.



answer = ifBlackout();



function ifBlackout() {



      var target = new GlideRecord('cmn_schedule_span');


      target.addQuery('type', 'Blackout');


      target.query();



while (target.next()) {


      gs.log("ced=" + current.end_date + "tsd =" + target.start_date_time + "ted=" + target.end_date_time, "BK:");


              if (current.end_date >= target.start_date_time && current.end_date <= target.end_date_time) {


                      return 'yes';


              }


              return 'no';


}


}



Returns ced=2014-08-10 18:17:02 tsd=20140801T120101 ted-20140810T235959



Based on the above the return is "No"