How to show Business Applications in the Service Status widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 02:54 PM
Situation: We are looking to implement the Service Status widget to our Service Portal. In testing, we are able to create an outage on a Business Service and get that outage to show up on the widget (working as expected). However, as a company, we do not have defined services and, up to this point, have only ever reported outages on Business Applications. When we create an outage on a Business Application, it does not show up on the Service Status widget.
Question: We have identified that the widget only looks at cmdb_ci_service and outages to display. Is there a way to expand what is shown on the widget beyond just Business Services to also include other ci classes while keeping all other functionality (showing history, ability to click into outage, etc)?
Additional Question: How are both Services and Business Services shown in Service Status widget? Looking in the PDI demo data, both Bond trading and Blackberry appear to be the same class (Business Service) and service classification (Business Service). I'm not sure where the delineation is listed that separates these two CIs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 09:47 AM
Hi,
Yes it's possible to do and a pretty easy customization of the widget functionality. As long as there is a record in the outage table, it's pretty simple.
Good to know as well if you dive deeper into Business Services, Service Offerings, Commitments etc. Then you will have some reporting issues since some parts of Developers in ServiceNow needs to improve their collaboration, since commitments are looking at outages on Service Offerings and widget on outages on Business services...
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 10:01 AM
Thank you for the reply!
We did a little playing around with the scripting inside of the widget and couldn't get it to work but I'm not an expert by any means. I believe the widget points to cmdb_ci_services right now, but I'm not sure of a table we could reference that includes both services and business applications that doesn't also include a bunch of other CIs that we wouldn't want to show on the page. Do you (or anyone else) happen to know how to change to code to look at 2 tables instead of just one?
I'm also still wondering what currently separates a business service from a service such that they show up in different spots, per the screen shots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 12:22 PM
It is possible to make service status widget look at all CIs instead of just 'cmdb_ci_service'.
Since its OOB widget you need to create a clone of the widget and implement this functionality.
The custom widget will have the following server side code
// populate the 'data' object
// e.g., data.table = $sp.getValue('table');
var outage = new GlideRecord("cmdb_ci_outage");
//outage.addQuery("cmdb_ci.sys_class_name", "cmdb_ci_service");
outage.addQuery("cmdb_ci.sys_class_name", 'CONTAINS', "cmdb_ci");
outage.addQuery("begin", "<=", gs.nowNoTZ());
outage.addQuery("end", ">=", gs.nowNoTZ()).addOrCondition("end", "=", "NULL");
data.service = (input && input.service) || $sp.getParameter("service");
if (!GlideStringUtil.nil(data.service)) {
outage.addQuery("cmdb_ci", data.service);
//var serviceGR = new GlideRecord("cmdb_ci_service");
var serviceGR = new GlideRecord("cmdb_ci");
if (serviceGR.get(data.service))
data.serviceDisplay = serviceGR.getDisplayValue();
}
outage.query();
data.outages = [];
data.outageIDs = "";
while (outage.next()) {
var out = {};
out.typeDisplay = outage.type.getDisplayValue();
out.type = outage.getValue("type");
out.details = outage.getValue("details");
out.ci = outage.cmdb_ci.getDisplayValue();
out.serviceID = outage.getValue("cmdb_ci");
out.begin = outage.begin.getDisplayValue();
data.outages.push(out);
data.outageIDs += "," + outage.getUniqueValue();
}
// populate the 'data' object
// e.g., data.table = $sp.getValue('table');
var outage = new GlideRecord("cmdb_ci_outage");
//outage.addQuery("cmdb_ci.sys_class_name", "cmdb_ci_service");
outage.addQuery("cmdb_ci.sys_class_name", 'CONTAINS', "cmdb_ci"); // updated to cmdb_ci
outage.addQuery("begin", "<=", gs.nowNoTZ());
outage.addQuery("end", ">=", gs.nowNoTZ()).addOrCondition("end", "=", "NULL");
data.service = (input && input.service) || $sp.getParameter("service");
if (!GlideStringUtil.nil(data.service)) {
outage.addQuery("cmdb_ci", data.service);
//var serviceGR = new GlideRecord("cmdb_ci_service");
var serviceGR = new GlideRecord("cmdb_ci"); // updated to cmdb_ci
if (serviceGR.get(data.service))
data.serviceDisplay = serviceGR.getDisplayValue();
}
outage.query();
data.outages = [];
data.outageIDs = "";
while (outage.next()) {
var out = {};
out.typeDisplay = outage.type.getDisplayValue();
out.type = outage.getValue("type");
out.details = outage.getValue("details");
out.ci = outage.cmdb_ci.getDisplayValue();
out.serviceID = outage.getValue("cmdb_ci");
out.begin = outage.begin.getDisplayValue();
data.outages.push(out);
data.outageIDs += "," + outage.getUniqueValue();
}
In this screenshot you can see that the Current Status widget shows the outage on a CI that is not cmdb_ci_service record.
But please bear in mind that the page (id=current_status) need to cloned/updated as well to show outages on all CIs instead of just 'cmdb_ci_service' as it currently just shows only those CI related outages.
Thanks
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 02:59 PM
The code you provided does exactly what I was asking about, thank you!
Unfortunately, it appears my fears of all of the other areas that will need to be updated appear to be true. Although this manipulates the service status widget, a quick look through makes me think I'm also going to have to make manipulations to several pages as well as the Planned Maintenance, Current Status, Service History, and Service Status Subscription widgets (and possibly more). It seems like a fair amount of customization.
Is it better to just consider the applications Services and move them from the Business Application table to the Business Services table?