The CreatorCon Call for Content is officially open! Get started here.

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Big change you've seen or even had to deal with the official ServiceNow HealthScan Scorecard at customers. The "ServiceNow HealthScan Scorecard provides an automated review of an instance". The PDF document optionally is accompanied with an Excel file pointing to all findings in detail.

 

While I'm not a fan of the HealthScan at all, I do feel the need to dive into some of the findings and share learnings I encounter at every single customer. In a few articles I will try to give a bit of explanation on findings, what you can do to solve them, and perhaps what you can do to prevent them in the first place. Some of the findings are solid gold, some of them are…

 

The first articles in this series will be a bit cherry picking, and then slowly progressing to more complex or time-consuming findings. Starting with the easy to solve findings to improve scores quickly and with minimal effort. Scores that often people in decision making places are sensitive to. Later on diving into more complex or time consuming findings, which are way more interesting for genuine developers.

 

Topics in this series of articles (I will update this section when publishing new articles):
- Update Sets should be named uniquely
- Use Notification Categories
- Populate Knowledge Base articles fully

- Report shared with a group which has no users
- Differs from baseline

- ...


HealthScan

"ServiceNow HealthScan Scorecard provides an automated review of an instance, to better understand instance health. HealthScan Scorecard uses a pre- defined library of best practice called definitions to inspect the instance. Only aggregated information is collected during this inspection scan, which is then analysed and compared. Details such as script names are not collected. The scores reflect alignment to the ServiceNow best practices, and give a high level summary only."

 

"ServiceNow HealthScan Scorecard is a high level overview of instance health. To get more detailed information, including advice on remediation, please contact the ServiceNow Customer Outcomes team who can advise you of options."

 

Report shared with a group which has no users

One of the definitions within the "Manageability" category concerns "Report shared with a group which has no users". ServiceNow explains this definition as:

"Check if the report should be really shared with this group and if not adjust the sharing options for it."

 

Identifying findings

The optional detailed Excel file provided with the ServiceNow HealthScan Scorecard will list all records identified as findings for this definition. Also links are included that take you to the findings in your instance directly.

 

How ServiceNow exactly determines the findings, I can't tell. Those details are not shared. What I can imagine though:

- Group by "Group" on records in table Report Users and Groups [sys_report_users_groups]

- Count number of records in table Group members [sys_user_grmember] based on the Group from the previous Group by
- Check for any occurrences with zero Group members

 

If you do not have the detailed Excel file, you could identify Notifications that have the Uncategorized Category value in multiple ways. From a list, background script, or my first go to: Instance Scan 😀.

 

Script Only Check

 

01.png

 

(function (engine) {

	var gaReportUsersAndGroups = new GlideAggregate('sys_report_users_groups');
	gaReportUsersAndGroups.addEncodedQuery('group_idISNOTEMPTY^report_id.active=true');
	gaReportUsersAndGroups.addAggregate('COUNT');
	gaReportUsersAndGroups.groupBy('group_id');
	gaReportUsersAndGroups._query();

	while (gaReportUsersAndGroups._next()) {
		var gaGroupMembers = new GlideAggregate('sys_user_grmember');
		gaGroupMembers.addEncodedQuery('group=' + gaReportUsersAndGroups.group);
		gaGroupMembers.addAggregate('COUNT');
		gaGroupMembers._query();

		if (gaGroupMembers._next() && gaGroupMembers.getAggregate('COUNT') == 0) {
			engine.finding.increment();

			engine.finding.setValue('source_table', 'sys_report_users_groups');
			engine.finding.setValue('count', gaReportUsersAndGroups.getAggregate('COUNT'));
			engine.finding.setValue('finding_details', gs.getProperty('glide.servlet.uri') + 'sys_report_users_groups_list.do?sysparm_query=group_id%3D' + gaReportUsersAndGroups.group + '%5Egroup_id.active%3Dfalse');
		}
	}

})(engine);

 

Instead of a Table Check and creating an individual Scan Finding for every occurrence found, I choose to create one Scan Finding. It's a choice, really up to you. My reason for choosing a Script Only Check, is that I am not interested in 20 separate Scan Findings where the Group is "xyz", 10 separate Scan Findings where Group is "abc", etcetera. Instead, having one Scan Finding per Group already fulfills. Of course with individual Scan Findings, one could go to the specific record immediately. For this, I've updated the "Finding details" field with a URL to all the records related to the Group that has no users.

 

Resolving findings

Having all findings available, we can start working on resolving them. How to resolve them depends a bit on your situation and your process. When it only concerns a hundred findings, you might solve them within 15 minutes by manually updating the Group in the Report Users and Groups record.

 

You can apply the correction on the Group field on your production instance directly.

 

Preventing findings

Out-of-the-box, reports shared with a group which has no users can occur. Because on creation of the report a Group without any users was attached, or because Group members were removed over time leaving the Group empty.

 

For the first situation we could come up with a technical solution, for the second situation this is more something that will just occur over time. I don't think we should try and prevent such from happening. Instead, identify such occurrences by monitoring. For example having a weekly Instance Scan Scan Suite "Data Quality", and acting promptly upon Scan Findings created.

---

 

That's it. Hope this helps you identifying, resolving, and preventing HealthScan findings. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

Independent ServiceNow Consultant
10x ServiceNow MVP

---

LinkedIn

Version history
Last update:
Sunday
Updated by:
Contributors