
- 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
‎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-27-2017 12:23 PM
Thank you for the reply. Sorry I hadn't gotten back to this discussion this month. I was sure I had read on other posts that this would be a way to accomplish what I was needing to do.
I am going to look into creating a business rule that would handle this metric. Thanks for the tip.
-Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 12:26 PM
I'm also wondering, do you know if there is documentation on using a business rule for a metric? I am trying to think about how I would go about setting this up and looking for ideas.
-Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 03:34 PM
No documentation using a business rule to capture a Metric that I'm aware.