- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 06:18 AM
I have been asked by the Service Coordinator to create a report that shows the total number times a Service Desk person has updated an Incident or a request. Any ideas or suggestion how I would go about doing that? Would I use the audit table? Are there any other suggestions or directions I can take in creating this report?
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2016 02:39 PM
Have you looked into using Metrics? You could only report on modifications after you have set this up but it will work.
- Create a new Metric Definition and name it Track Updates. Here is a screenshot. Make sure you have on the Incident Table, Field is Updated.
- Create a Business Rule on the Incident Table.
On the Advanced tab enter the following script:
(function executeRule(current, previous /*null when async*/) {
var definition = new GlideRecord('metric_definition');
definition.addQuery('name','=','Track Updates');
definition.query();
if (definition.next()) {
var mi = new MetricInstance(definition, current);
var gr = mi.getNewRecord();
gr.field_value = current.sys_updated_by;
gr.field = null;
gr.calculation_complete = true;
gr.insert();
}
})(current, previous);
Now on every update a new metric instance is created with the name of the person who made the change. You can not use the normal reporting you do for metrics to report on who changed, how many times, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2017 06:23 AM
Hi all - I copied and pasted the same code onto the advanced tab and got the following message...
(function executeRule(current, previous /*null when async*/) {
02. var definition = new GlideRecord('metric_definition');
03. definition.addQuery('name','=','Track Updates');
04. definition.query();
05. if (definition.next()) {
06. var mi = new MetricInstance(definition, current);
07.
08. var gr = mi.getNewRecord();
09. gr.field_value = current.sys_updated_by;
10. gr.field = null;
11. gr.calculation_complete = true;
12. gr.insert();
13. }
14.
15.})(current, previous);
Could not save record because of a compile error: JavaScript parse error at line (2) column (9) problem = missing name after . operator (<refname>; line 2)
Does anyone know how to fix this error? I am an admin...not a developer. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 02:56 PM
Hi,
The Metric and business rule work. However, depending on the type of update the count is impacted differently. Example In my instance (Orlando) the metric counts a worknote update as 1 update. However, If I update a public note the metric counts 3 updates with the same time stamp on the ticket. Can you provice an explanation for the count?