Outage on Change Request Form

SN Rookie
Giga Expert

As a change manager I would like a field on the form asking if an outage is required to ensure initiators are adding outages where required

Mandatory field (not when the form is in draft stage) - Outage required? Yes or No

If Yes, need to have an outage record included on the change related list before submitting for approval with error message appearing with message 'Right click on grey bar and click 'Create Outage'.

If there's already an Outage linked, it should allow the form to be submitted.

How can we achieve this?

1 ACCEPTED SOLUTION

Weston Wilson
Tera Expert

You can do a UI/Data policy or client script to set the outage_required field mandatory under condition of state != -5 (or whatever draft state is). 

Then you can have an on update business rule for checking if there is an associated outage when outage_required is true. 

var gr = new GlideRecord('outage_table_name');
gr.addQuery('change', current.sys_id); //Whatever field on the outage relates to the current change record
gr.query();

//If nothing is found, abort action
if (!gr.hasNext()){
    gs.addErrorMessage("Right click on grey bar and click 'Create Outage'")
    gs.setAbortAction(true);
}

View solution in original post

1 REPLY 1

Weston Wilson
Tera Expert

You can do a UI/Data policy or client script to set the outage_required field mandatory under condition of state != -5 (or whatever draft state is). 

Then you can have an on update business rule for checking if there is an associated outage when outage_required is true. 

var gr = new GlideRecord('outage_table_name');
gr.addQuery('change', current.sys_id); //Whatever field on the outage relates to the current change record
gr.query();

//If nothing is found, abort action
if (!gr.hasNext()){
    gs.addErrorMessage("Right click on grey bar and click 'Create Outage'")
    gs.setAbortAction(true);
}