
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
10-04-2020 11:06 PM - edited 08-18-2024 06:18 AM
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 🙂 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!
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!
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? |
Kind regards,
Mark Roethof
ServiceNow Technical Consultant @ Quint Technology
1x ServiceNow Developer MVP
1x ServiceNow Community MVP
---
- 5,325 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Mark ,
I am trying to apply conditions on the Scripted Metric but it soesn't seem to work, Can you please help me on this ?
https://community.servicenow.com/community?id=community_question&sys_id=92bd9c38db5b18903daa1ea66896191d
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Very helpfull, thank You. I was creating metrics on my custom table and I was curios why it is not working. Thanks to this article i made my business rule copy in relation to my table and metrics started to work with new records in my table.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hey @Mark Roethof, et al,
Thanks for sharing this. I followed exactly the steps but no metrics created under my metrics definition. Can you please let me know where did I missed?
Overview: Need to keep the history of Description field value changes in Control (sn_compliance_control) form
1. Metric Definition:
2. Business Rules:
2.a When to run:
2.b Advanced:
2.c Note that I created global GlideScriptRecordUtil to solve the 'GlideScriptRecordUtil is not allowed in scoped applications' problem (Ref)
3. I also have set sn_grc_item table collection to be audit = true
4. I also checked the scheduled job next run: 'metric update events process' to test (KB0963918 )
But there is still no metric created when I changed the Controls Description field.
Appreciate any help here. Been hitting walls for hours now.
Advanced thanks!
Anna.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I have done exactly this for the awa_agent_presence_history table. It captures the time when an agent presence starts, but i cannot get it to capture (and therefore calculate) when an agent presence ends. I've tried using scripts from other definitions that are known to work, but getting nowhere.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
FYI: For metrics in scoped app, this article may also be helpfull: Metrics in Scoped Apps - ServiceNow Community