Service status - current outage detailed not showing

RudhraKAM
Tera Guru

Hello 

We are configuring Service status in our portal I have couple of questions . We cloned this below widget (current status ) and replaced it with the new 

RudhraKAM_2-1675817884923.png

 

and want to do some customizations. when there is an Outage and it will show up on the current status but up on clicking that active outage it is not showing the below page. 

RudhraKAM_1-1675817820173.png

 

As of OOB it is pointing to cmdb_ci_services we want to show only application ( cmdb_ci_appl)  services. below is the code where I replaced it with cmdb_ci_appl but still not able to see the above page up on clicking.

HTML 

 

 

<div ng-if="!data.service || data.outages.length > 0" class="panel panel-{{options.color}} b">
  <div class="panel-heading">
    <h3 class="panel-title">${Current Status}<span ng-if="data.serviceDisplay"> - {{data.serviceDisplay}}</span></h3>
  </div>

  <div class="panel-body">
    <div ng-if="!standalone && !data.service" class="hidden-xs">${We constantly monitor our services and their related components.} ${If there is ever a service interruption, a notification will be posted to this page.} ${If you are experiencing problems not listed on this page, you can submit an  <a href="/esm?id=sc_cat_item&sys_id=196e884e6d96710091d45153d578793c">Incident</a> .}</div>

    <div ng-if="data.outages.length == 0" class="col-xs-12 bs-callout bs-callout-success">
      <div ng-if="!data.service">${No system is reporting an issue}</div>
    </div>
    <div ng-if="data.outages.length > 0" ng-repeat="outage in data.outages" class="col-xs-12 bs-callout bs-callout-{{outage.type}}">
      <a ng-if="!data.service" style="color:inherit" ng-href="?id=service_status&service={{outage.serviceID}}">{{outage.typeDisplay}} - {{outage.ci}} (${started {{outage.begin}}})
        <div ng-if="options.show_outage_details == 'true' && outage.details" ng-bind-html="::trustAsHtml(outage.details)" class="sp-outage-details"></div>
      </a>
      <span ng-if="data.service" style="color:inherit">{{outage.typeDisplay}} - {{outage.ci}} (${started {{outage.begin}}})
        <div ng-if="options.show_outage_details == 'true' && outage.details" ng-bind-html="::trustAsHtml(outage.details)" class="sp-outage-details"></div>
      </span>
    </div>
    <div ng-if="::standalone"><a href="?id=services_status" aria-label="${More information, open current status page}">${More information...}</a></div>
  </div>
</div>

 

 

 

 

Server script

 

 

// 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", "IN", options.sys_class_list || "cmdb_ci_appl");
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_appl");
	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();
}

 

 

 

 

Client Script 

 

 

function ($scope, spUtil, snRecordWatcher, $rootScope, $sce) {
	var c = this;
	$scope.standalone = $scope.options.standalone == 'true' || $scope.options.standalone == true;
  var q = "cmdb_ci.sys_class_name=cmdb_ci_appl";
  if ($scope.data.outageIDs != "")
    q += "^NQsys_idIN" + $scope.data.outageIDs;
	
	spUtil.recordWatch($scope, "cmdb_ci_outage", q, function() {
		$scope.server.update();
		$rootScope.$broadcast("sp.outage.updated");
	});
	
	$scope.trustAsHtml = function(html) {
		return $sce.trustAsHtml(html);
	};
	
}

 

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @RudhraKAM ,

The 'Service Status' widget shows outage information related to a business service for the past 90 days (backdated from the current date). This widget only shows limited information like outage message and date. But it doesn't show full outage details like task number, short description, etc.,

Service status widget

The 'Service Status' widget on the 'service_status' portal page requires a business service (cmdb_ci_service) as an input parameter in the URL. It gives outage information related to the Business Service record for the past 90 days. This is the direct URL of the OOB 'Service Status' widget.

https://<instance-name>.service-now.com/sp_widget.do?sys_id=0d76f656d7330200a9addd173e24d450

Example

  1. Navigate to 'cmdb_ci_outage' table list view. Open any outage record and note down the 'sys_id' of the business service associated with this outage.
  2. Use the below URL to view the service status of this Business Service in the portal:
    https://<instance-name>.service-now.com/sp?id=service_status&service=<business_service_sys_id>
  3. Hover over any chiclet that is in green color. It shows the tooltip as 'No issues' and the 'Date' that corresponds to the chiclet.
  4. Hover over any chiclet that is in red color. It shows the tooltip as 'Outage' and also the 'Date' on which it occurred.

Observe that full outage details like a short description, task number, etc., aren't shown on the tooltip. This is working as per design and the OOB 'Service Status'  widget is not configured to show complete outage details. However, this behavior can be changed by customizing this widget. For example, if we would like to show 'short_description' of the outage on the tooltip:

  1. Create a clone of the 'Service Status' widget. Modify the server script of the widget to push 'short_description' of an outage record to the 'day' array (you might need to add the script after line no.25)
  2. After pulling the value of 'Short Description' we can make use of this in the HTML template using OOB angular directive ng-bind-html.

Additional Information

You can also clone OOB 'Service History' widget to show full details of an outage record on the portal page 'service_status'.

 

View solution in original post

2 REPLIES 2

Community Alums
Not applicable

Hi @RudhraKAM ,

The 'Service Status' widget shows outage information related to a business service for the past 90 days (backdated from the current date). This widget only shows limited information like outage message and date. But it doesn't show full outage details like task number, short description, etc.,

Service status widget

The 'Service Status' widget on the 'service_status' portal page requires a business service (cmdb_ci_service) as an input parameter in the URL. It gives outage information related to the Business Service record for the past 90 days. This is the direct URL of the OOB 'Service Status' widget.

https://<instance-name>.service-now.com/sp_widget.do?sys_id=0d76f656d7330200a9addd173e24d450

Example

  1. Navigate to 'cmdb_ci_outage' table list view. Open any outage record and note down the 'sys_id' of the business service associated with this outage.
  2. Use the below URL to view the service status of this Business Service in the portal:
    https://<instance-name>.service-now.com/sp?id=service_status&service=<business_service_sys_id>
  3. Hover over any chiclet that is in green color. It shows the tooltip as 'No issues' and the 'Date' that corresponds to the chiclet.
  4. Hover over any chiclet that is in red color. It shows the tooltip as 'Outage' and also the 'Date' on which it occurred.

Observe that full outage details like a short description, task number, etc., aren't shown on the tooltip. This is working as per design and the OOB 'Service Status'  widget is not configured to show complete outage details. However, this behavior can be changed by customizing this widget. For example, if we would like to show 'short_description' of the outage on the tooltip:

  1. Create a clone of the 'Service Status' widget. Modify the server script of the widget to push 'short_description' of an outage record to the 'day' array (you might need to add the script after line no.25)
  2. After pulling the value of 'Short Description' we can make use of this in the HTML template using OOB angular directive ng-bind-html.

Additional Information

You can also clone OOB 'Service History' widget to show full details of an outage record on the portal page 'service_status'.

 

Thanks for the reply sandeep , but even after cloning and modifying the cmdb_services to applications table (code provided in the above question ) displaying the outages in application table but not able to see any information up on clicking. what am I missing