Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change Review process

DSV22
Tera Contributor

Hi Team,

 

A Pop-up message has to appear to the change managers when a service attached to the change is not operational status

 

I have created the Display BR and also client script for this.

 

Regards

Vivek 

2 REPLIES 2

Hardik2109
Tera Guru

Hi,
1.png

222.png

(function executeRule(current, previous /*null when async*/ ) {

var statusArr = [];
var serviceGR = new GlideRecord('task_cmdb_ci_service');
serviceGR.addEncodedQuery('task='+current.getUniqueValue().toString());
serviceGR.query();
while (serviceGR.next()) {
statusArr.push(serviceGR.cmdb_ci_service.operational_status.getDisplayValue()); //1 = operational;2 = non-operational
}
gs.info('statusArr:: '+statusArr);
var arrayUtil = new ArrayUtil();
if (arrayUtil.indexOf(statusArr, "Operational") == -1) // present operational service
g_scratchpad.operation_status = "all non-operational";
else
g_scratchpad.operation_status = 'operational';


})(current, previous);

3333.png

function onLoad() {

if (g_scratchpad.operation_status == 'all non-operational')
alert("Please confirm there are no configuration updates as a part is this change");
}

 

 

Regards,

Hardik 

**Please mark my answer correct or helpful based on the impact**

DSV22
Tera Contributor

Hi @Hardik2109,

 

Thanks, But the script part that I have completed already. I need the next step further that needs to be done for a story

 

Regards

Sai