logo

NJP

Metrics on non-Task tables

Import · Oct 05, 2020 · article

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

Hi there,

Where it comes down to advanced reporting, quickly Performance Analytics jumps in mind. Though ServiceNow out-of-the-box also comes with this nice - free - functionality called Metrics. You might even have heard of it or are working with it, nice! Though, why isn't it working for all tables on your instance? For example Approvals [sysapproval_approver]?

Metrics

A short recap on Metrics can be found on the Docs:

"A metric measures and evaluates the effectiveness of IT service management processes.

For example, a metric could measure the effectiveness of the incident resolution process by calculating how long it takes to resolve an incident."

The Docs page does specifically mention IT. Though actually, who cares image We can use it for any process!

Task extended

Out-of-the-box, the working of Metrics is limited to Task extended tables. Out-of-the-box also several Metric Instances are active and collect Metric Definitions. You might not even be aware of this! Navigate to "Metrics > Definitions" to see what already has been captured on your instance out-of-the-box.

While configuring and testing new Metric Instances, you will eventually notice that you can select (almost) every table. Though, on for example Approvals it actually doesn't work [sysapproval_approver]?

Again from the Docs:

"Note: In the base system, metrics are configured to work on the task table only."

Applying Metrics on non-Task extended tables

So how can we use Metrics on non-Task extended tables? Like the Approvals [sysapproval_approver] table for example?

An important artifact behind the Metrics functionality is a Business Rule called "metrics events". This Business Rule runs on table Task [task]. If you are after applying Metrics on a non-Task extended table, you can actually simply duplicate this Business Rule!

image

For our example of the Approvals table, simply duplicate the "metrics events" Business Rule and set the table to Approval [sysapproval_approver].

If you are after having metics on for example the Server [cmdb_ci_server] table, you could again duplicate the "metrics events" Business Rule and set the table to Server [cmdb_ci_server] or even Configuration item [cmdb_ci] so all Configuration item extended tables can make use of Metrics as well.

Result

You could already setup Metric Instances to (almost) every table. Though while testing, Metric Definitions would not be captured for non-Task extended tables. After duplicating the "metrics events" Business Rule, Metric Definitions now will automatically be captured for the table (and extended tables) you selected.

---

And that's it actually. Hope you like it. If any questions or remarks, let me know!

Kind regards,

Mark Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

image

View original source

https://www.servicenow.com/community/developer-articles/metrics-on-non-task-tables/ta-p/2308846