Workflow – Check Blackout Conflict
ServiceNow Tipps
·
Dec 18, 2017
·
article
During our Change Management implementation in ServiceNow we realized that we need to change the Change Request – Normal workflow to check if the change is scheduled during Blackout. If that is the case, we wanted to have one additional approval.
As there was no default option to check for the Blackout conflict, we used this script to get a ‘yes’ or ‘no’ answer within the IF activity.
var count = new GlideAggregate('conflict');
count.addQuery('type','blackout');
count.addQuery('change.sys_id',current.sys_id);
count.addAggregate('COUNT');
count.query();
var conflicts = 0;
if(count.next())
conflicts = count.getAggregate('COUNT');
answer = ifScript();
function ifScript() {
if (conflicts>0) {
return (‘yes’);
}
else
{
return (‘no’);
}
}
https://servicenowtipps.wordpress.com/2017/12/18/workflow-blackout/