Create outage if "outage required" is checked on Change

Dark Ranger
Tera Contributor

Hi All,

I was wondering if anyone has done something similar to this or could tell me how I could go about doing this.

I want an outage to automatically be created if the "Outage Required" box in a change is checked.

This would automatically raise the Outage and use the CI from the change and also the planned start and planned end as the "begin" and "end" dates on the Outage.

Thanks

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Haven't done it. But seems easy

 

You need a business rule which should check, if Outage Required changed to true

And then run below business rule

 

var outage = new GlideRecord('cmdb_ci_outage');;

outage.cmdb_ci = current.cmdb_ci;

outage.begin = current.start_date;

outage.end = current.end_date;

outage.type = 'planned';

outage.insert();


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

Haven't done it. But seems easy

 

You need a business rule which should check, if Outage Required changed to true

And then run below business rule

 

var outage = new GlideRecord('cmdb_ci_outage');;

outage.cmdb_ci = current.cmdb_ci;

outage.begin = current.start_date;

outage.end = current.end_date;

outage.type = 'planned';

outage.insert();


Please mark this response as correct or helpful if it assisted you with your question.

Nice start Sanjiv

we have implemented this for the same reason (planned outages for change)

and a few additions here have helped get this working well

You have to have a reference to the change record so you must include

   outage.task_number=current.sys_id;

otherwise the outage record will not appear in the related list in change.

one thing we have noticed with the NewYork version is that Short description in the outage record is necessary where previously it was not (maybe our config)

in our design we are using service offerings from service portfolio so we add short descriptions as

   outage.short_description=current.service_offering.name;

but you could also add any other field here or combination, we are also thinking of adding the date at the end of the service offering eg current.service_offering.name & " " & date

so we have a bit more uniqueness in the lists of outage records

we also include

   outage.message=current.short_description;

so that we can leverage the message in the portal from the outage record but this is optional

and also optional

   outage.details=current.description;

hope that help people who want to include planned outages in their portal widgets automated from the change process

 

it works for us