Service Portal - Edit Service Status Widget to Show current Status

alexcolbert
Kilo Guru

Hi Community,

I have a question relating to the service status widget in an OOB service portal.

Currently when we register an outage, it shows correctly in the "Current Outage" section on the portal homepage, and clicking on system status also shows the current outage information.

What I have noticed is that whilst an outage is on-going, clicking the affected business service does not show a red mark for the current day in the widget on the system status page (Business Service - Last 90 days), it will only go red once the outage has finished.

1.

SN Outage.PNG

2.

      SN Outage2.PNG

I understand that the default functionality is to show historical outages on this particular widget, hence why this widget only shows a red mark once the outage is finished.   But is there a way for this widget to show a red mark whilst the outage is on-going?

Everything is OOB at the moment so I haven't changed any coding yet, so any ideas here would be appreciated.

Thanks!

1 ACCEPTED SOLUTION

larstange
Mega Sage

oh sorry, it was line 9 that needed to be changed


View solution in original post

10 REPLIES 10

larstange
Mega Sage

oh sorry, it was line 9 that needed to be changed


Thanks for the superb help Lars.   It's all working now


Thanks for this.



This wasn't a requested feature (we haven't gone live yet, but I'm nearing finalization) however, this seemed like a good idea to have implemented so I've cloned the service status widget and made these changes to lines 11-23 and to confirm to anyone else who may be reading this, you will have to add an extra ) at the end of the line that he posted as "oh sorry, it was line 9 that needed to be changed". The extra ) is needed to close out the code before the ending ; - otherwise you'll see a red x indicating a problem with that line of code.



Thanks!



Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

tsutherland
Kilo Sage

I realize this is a super old post, but has anyone tried doing something similar by copying the Business Services Status widget?  My code below using @larstange and @Allen A responses but it still is not showing in the widget unless the outage is closed.

 

                var svc = {};
		svc.sys_id = svs.getUniqueValue();
		svc.name = svs.getDisplayValue();
		svc.safeName = GlideStringUtil.escapeHTML(svc.name);
		svc.subscribed = isSubscribed(svc.sys_id);
		var outs = [];
		for (var i = 0; i <= 4; i++) {
			var out = new GlideAggregate("cmdb_ci_outage");
			out.addQuery("cmdb_ci", svs.getUniqueValue());
			if (i > 1)
			out.addQuery("end", ">=", gs.daysAgoStart(i));
			else
	out.addQuery("end", ">=", gs.daysAgoStart(i).addOrCondition("end", "=", "NULL"));
			out.addQuery("begin", "<=", gs.daysAgoEnd(i));
			out.addAggregate('COUNT', 'type');
			out.query();
			var svcOutageDay = {};
			svcOutageDay.count = 0;

Suresh Panchum1
Kilo Contributor

Please have below code applied to make it work and consider for open outages.

//out.addQuery("end", ">=", gs.daysAgoStart(i));

var dtend = out.addQuery("end", ">=", gs.daysAgoStart(i));
dtend.addOrCondition("end", "=", "NULL");