How to track total time duration when the field value changes using Metric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 11:45 PM
How to create a report to track total time duration when the field "On Hold Reason" changes using metric definition.
Problem :
To find the time spent by the Legal Fulfiller , Legal User and 3rd Party on the ticket/ request.
Resolution :
When the state changes to On Hold and using the On Hold Reason (i.e. Awaiting Requestor, Awaiting External Company, Awaiting Collaborator, Awaiting Approval) we can track time spent by the Legal Fulfiller, Legal User and 3rd Party on the ticket/ request.
In ServiceNow, a metric definition is a way to track changes on any field in any table. It captures details such as when the change occurred, who made the change, how long the change lasted, and the old and new values of the field. This tracking is done through the metric_instance table, where each instance represents a specific change event.
- To install the Metric Definition plugin (com.glide.metrics), navigate to System Definition > Plugins, search for Metric Definition, and click Install.
- Navigate to metric_definition_list.do (OR)
- Navigate to All > Metrics > Definiions.
- Click on NEW.
- Select the table that you want to collect metrics for. A metric can only apply to one table. Select the table column that you want to monitor for changes.
- Field value duration: This type of metric measures the duration of time from when the value of the specified field is set until it’s changed. A Field value duration metric can optionally specify a script.
- Script calculation: This type of metric creates a metric instance using a script.
- Check the timeline box to display the metric on a timeline page.
- A good description helps other metrics administrators understand the purpose of your metric.
- The related list shows here the Duration :
- Value: For a "Field value duration" metric this is the value of the table field for which duration is calculated. For example, for the "On Hold Reason" metric, the Value is the name of the choice selected on the request.
- ID: Identifies the specific record for which the metric is gathered.
- Duration: Time duration for a Field value duration metric.
You may proceed to create a report of this metric definition by using the table source: metric_instance
Sample Report:
Report for tracking time spent by Legal Fulfiller , Legal User and 3rd Party :
- 708 Views