
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:38 PM
I have a feeling that I may be missing something simple. I am trying to create a metric that will record the first person to update an incident. I will also be creating this on other tables but am starting with incidents first. I have created a metric against the Incident table and have it watching the Updates (sys_mod_update) field, the type is set to Script Calculation. Here is the script that I wrote for the this:
var mod = current.sys_mod_count;
if (mod == '1') {
createMetric();
}
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.value = current.sys_updated_by;
gr.calculation_complete = true;
gr.insert();
}
I have tried multiple variations of this script and not having any good results. I started looking at the metric_events business rule today, so I am not sure if I need a new business rule to get this to start or not. Any advice you can offer is appreciated.
Thanks
-Chris
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 12:55 PM
Metrics only work on audited fields. By default, the system does not audit records from system tables. To audit a system table, add it to the list of tables in the glide.ui.audit_deleted_tables property list.
You can also use a business rule to generate Metric's on system fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 07:04 AM
Appreciate the help either way.
Thanks
-Chris