- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2014 10:39 PM
I want to capture the assignment group at the time of SLA breach on task table. So I am using the below code
if (current.active) {
if (current.has_breached.getDisplayValue() == 'true') {
createMetric();
}
}
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.field_value = current.task.assignment_group;
gr.calculation_complete = true;
gr.insert();
}
But this isn't capturing any records. Plese advice me where am i doing wrong ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 11:16 PM
Got the solution. I added metric event for task_sla table and now its working as per my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2014 10:57 PM
Hi Reza,
Could you please give clear idea why you are using Metric
If I am not wrong, you want to populate the group name when SLA breached.
It can be done with client script when SLA breached we can capture the current group of user and do the need full action by calling script include in client script like send notification.
Thanks,
Pavan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2014 11:16 PM
Hi Pavan
I need it for the reporting purpose. We need to create reports on a monthly basis for the tickets which has been breached(for all priorities) and which assignment group was in charge during the breach. Since I have seen scenarios where the assignment group changes after the ticket has been breached. So I want the correct assignment group who breached the ticket for business purpose.
Please help why my metric is not capturing any data.
Thanks,
Reza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2014 11:37 PM
Hi Reza,
Actually when your Metric runs that time which group is assigned will get that group only.
We dont have direct option to do this in service now to see the group which was there at the time of SLA breached.
For your requirement we can do like , will create one entry in one table at the time SLA breached, will use that table while creating report.
If you got an idea through this please mark as answered one.
Thanks,
Pavan Poul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 06:43 AM
Thanks for the support but via metrics whenever the Has Breached value changes it will trigger the metrics instance to insert a record. So whenever any ticket breaches, that moment it will get the current assignment group and will create a new record in metric_instance table.
I am able to do other reporting stuffs through incident table via my custom metrics but using task_sla table it is somehow not triggering my metric.
Thanks,
Reza