Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Report on Assets which has changed the Location.

MFO1911
Tera Contributor

Hello togehter,

 

For our asset management, we need to produce a monthly scheduled report of all assets that have changed location.

The scheduled report should be an excel file listing all assets that are changed from a specific location to another specific Location and vice versa.

 

For Example: Asset A - with Location- A changes from Location A to Location B for Last Month

 

Is there an easy possibility for a simple report? If yes, please can someone explain in detail how to configure this report step-by-step? Do I have you to use Performance Analytics reports? I did not found a OOTB report or indicator.

 

Best Regards

 

MFO

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Tai Vu
Kilo Patron
Kilo Patron

Hi @MFO1911 

You can define a Metric Definition to track the changes on the Location field. Once the Location changes, it will generate a new record into Metric Instance [metric_instance]. Then you can do reporting on this table.

Sample below

TaiVu_0-1697709434936.png

 

You can also leverage the Audit [sys_audit] table, if your instance has enabled audit for the Location field in alm_asset.

 

Try not to use sys_history_line and sys_history_set. Refer to this KB #KB0744473

TaiVu_1-1697709635156.png

 

Let me know if it works for you.

 

Cheers,

Tai Vu

 

View solution in original post

Hi @MFO1911 

Seems I missed this one. 😜

The metric instance generation is handled by this business rule.

Name: metrics events

URL: https://<instance_name>/sys_script.do?sys_id=35f9861dc0a808ae00ecf631cc51888c

 

Just clone the Business rule and change the table to Asset [alm_asset]. The event will be fired to generate metric instance.

 

Cheers,

Tai Vu

 

View solution in original post

8 REPLIES 8

Tai Vu
Kilo Patron
Kilo Patron

Hi @MFO1911 

You can define a Metric Definition to track the changes on the Location field. Once the Location changes, it will generate a new record into Metric Instance [metric_instance]. Then you can do reporting on this table.

Sample below

TaiVu_0-1697709434936.png

 

You can also leverage the Audit [sys_audit] table, if your instance has enabled audit for the Location field in alm_asset.

 

Try not to use sys_history_line and sys_history_set. Refer to this KB #KB0744473

TaiVu_1-1697709635156.png

 

Let me know if it works for you.

 

Cheers,

Tai Vu

 

MFO1911
Tera Contributor

Hi @Tai Vu,

 

Thanks for the quick reply. I have created a metric definition for the table "alm_asset" on the location field.

 

Then I changed the location of some sample assets. However, no metric is being created that we can use for reports. Does this take a while to create, or should the metric be created immediately after the change?

 

The Audit (sys_audit) for the Table alm_asset - collection is active -true. But the Old / New Value is only the sys_id of the location...so this cant be used for the report. The sys_history_line table has the correct location but should not used like explained in the Knowledge Base article. 

Maybe a Performance Analytics Report with a Daily Data Collection Job can help?

 

Best Regards 

 

MFO

Hi @MFO1911 

Seems I missed this one. 😜

The metric instance generation is handled by this business rule.

Name: metrics events

URL: https://<instance_name>/sys_script.do?sys_id=35f9861dc0a808ae00ecf631cc51888c

 

Just clone the Business rule and change the table to Asset [alm_asset]. The event will be fired to generate metric instance.

 

Cheers,

Tai Vu

 

MFO1911
Tera Contributor

Hi @Tai Vu,

 

Thank you for your quick reply. I have created the business rule as you described, and it is now working fine. 

 

Many thank and Best Regards.

 

MFO

 

Many thanks and Best Regards

 

MFO