- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 02:14 PM
Hello,
When a new incident is being created, i want to know what active outages exist in the environment so that I do not create duplicate tickets and can provide details to users reporting the same issue.
When an outage is active and a user is viewing an Incident form via the frameset, a banner message appears at the top of the form explaining that there is currently an outage. This banner should also display the affected CI and the time the outage began.
Has anyone done something like this? Any input is appreciated.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 06:21 PM
Try using this and it should work
(function executeRule(current, previous /*null when async*/) {
// Add your code here
gs.addInfoMessage('Entering Business Rule to display outage');
var now = new GlideDateTime(gs.nowDateTime());
var outage = new GlideRecord("cmdb_ci_outage");
outage.addQuery('type', 'Outage');
outage.addQuery("begin", "<=",now);
outage.addQuery("end", ">",now).addOrCondition("end", "=", "NULL");
outage.setLimit(5);
outage.query();
if (outage.next()) {
gs.addInfoMessage('Entering outage check to get CI value');
var outageci = outage.cmdb_ci.getDisplayValue();
gs.addInfoMessage("This is a test for outage");
gs.addInfoMessage("Outage opened for " + outageci);
}
})(current, previous);
Hope this helps
Mark this response as correct if that really helps
Thanks,
Siva

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 02:45 PM
hi Roy,
It depends on how is the trigger to determine the outage...
if its based on selection of "Services", then you can achieve this by having on_change client script to query the outage details...if there is an active outage, show error message...
where is if the triggering condition is from server side, trigger an gs.addXXXXMessage to alert the user.
details:
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:09 PM
Hi Bryan,
Thanks for the input. Basically any active outages should be displayed at the top of the incident form when a new incident is being created.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:45 PM
hi Roy,
In this case, perhaps u can explore on Display business rule for incident to show all active outages - this will display on every incident form.
If you want it to be display "after" an incident been created, modify the UI action for the incident creation to display all outages.
I think it is not going to be pretty on the form if you have lots of active outages...
second thought is I thought the whole idea is to prevent user from raising a duplicate incident?
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:55 PM
Thanks. I will try the Business Rule and see if it works. You are right, the whole idea is to prevent a user from raising a duplicate incident,