Identify previous and current values of a field using metric definition


Description

User has a requirement that he want to see the transitioned value(both) in the metric definition parameter. As an example, someone changed location from London to new York for Asset-XYZ. Identify the feasibility of fetching both London and New York in metrics data.

Release or Environment

All

Instructions

To achieve this we need to create a metric definition followed by a Business Rule.

Step1: Creating a metric definition1) Login to the instance
2) Navigate to Metrics -> Definitions
3) Click on New and provide below details
a) Name = Testing_Location
b) Table = alm_asset
c) Field = Location
d) Description = Track location change
Submit the record

Step 2: Creating a Business Rule
1) Navigate to System Definition -> Business Rules
2) You will see a record with 'metric events' on the task table
3) Click on New and create the similar business rule on 'alm_asset' table
Make sure the name is 'metric events'. Please find the screenshot 1
4) Copy paste the script that you see in 'metric events' on task table to the 'alm_asset' table
No script changes required
5) Ensure 'When to Run', 'Actions', 'Advanced Tab' are same as in 'metric event' for task table.
Submit the business rule

Now navigate to alm_asset table and change the location for any record.
The change should capture in sysevent table and also in 'metric_instance table'.
Please find the screenshot below.




Additional Information

Metrics Instance