Service Portal Status History
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2018 02:43 PM
I am trying to figure out why the "Last 90 days" and the "Status History" sections of the system status is showing as green when there is a current (not ended) outage on a business service. For example, I have a degradation on SAP Human Resources which started long ago...
The Status History shows as follows:
And the Service Status page shows:
The moment I enter an end date on the outage, it all updates with a history of a degradation.
It would be nice for a current outage to show as such on these pages even before the outage is ended. Is this intended, do I have a bug?
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2018 05:53 AM
Hello,
OOB the widget doesn't show the "current" status in the 90 day history bar. It only shows once disruption has ended.
You can however, clone and modify the code to make it show there as well by following instructions in this link: https://community.servicenow.com/community?id=community_question&sys_id=c868c3eddb1cdbc01dcaf3231f96...
I did and it worked for me.
Thanks!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 07:54 AM
OK, so that link appears to be dead but I'll just drop this script here, because I got it working with this.
This is a replacement for the Server Script in the Service Status widget.
// populate the 'data' object
// e.g., data.table = $sp.getValue('table');
data.systemStatusBreadcrumb = gs.getMessage("System Status");
data.navHelpMsg = gs.getMessage("Use left/right arrow keys to navigate the status history");
data.service = $sp.getParameter("service");
var service = new GlideRecord("cmdb_ci_service");
if (service.get(data.service))
data.serviceDisplay = service.getDisplayValue();
else
(data.service = null);
data.days = [];
for (var i = 89; i >= 0; i--) {
var day = {};
day.date = new GlideDateTime(gs.daysAgo(i)).getLocalDate().getDisplayValue();
var out = new GlideAggregate("cmdb_ci_outage");
out.addQuery("cmdb_ci", service.getUniqueValue());
out.addQuery("begin", "<=", gs.daysAgoEnd(i));
out.addOrCondition("end", ">=", gs.daysAgoEnd(i));
out.addOrCondition("end", "IS", null);
out.addAggregate('COUNT', 'type');
out.query();
day.count = 0;
while (out.next()) {
var type = out.type;
var typeCount = out.getAggregate('COUNT', 'type');
day[type] = typeCount;
day.count += typeCount;
}
day.msg = gs.getMessage("No issues");
day.color = "#5cb85c";
day.id = "no-issues";
if (day.count > 1) {
day.msg = gs.getMessage("Multiple issues");
day.color = "#6E4CDD";
day.id = "multiple";
} else if (day.outage > 0) {
day.msg = gs.getMessage("Outage");
day.color = "#BB0000";
day.id = "outage";
} else if (day.degradation > 0) {
day.msg = gs.getMessage("Service degradation");
day.color = "#f0ad4e";
day.id = "degredation";
} else if (day.planned > 0) {
day.msg = gs.getMessage("Planned maintenance");
day.color = "#5bc0de";
day.id = "planned-maintenance";
}
data.days.push(day);
}