- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 09:07 AM
I want to create a metric on task_sla table. This table contains has_breached field. When ever that field is true, I want to capture the assignment group at that particular time when the SLA is breached.
I have created a metric on Task_sla table and struck up at the scripting part.
Any help is appreciated.
Thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2016 05:12 AM
So your getting some data? Change the script to this:
if (current.has_breached == true) {
createMetric();
}
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.value = current.task.assignment_group;
gr.calculation_complete = true;
gr.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 05:26 PM
Hi David,
I am unable to capture the records. Can you help me on this?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 11:49 AM
This article has a similar solution: Metrics scripting
In order to get any solution to work, you'll have to copy the business rule - metrics events - to the task sla table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 05:25 PM
HI Michael,
I have created the business rule on task_sla table. Can you tell me what would be the event to be created on task_sla table?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 05:31 PM
You shouldn't have to change the event, just copy the BR and change the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2016 06:17 PM
Yes. I have created the business rule on task_sla table. And I have created the event on task_sla table. I know I am missing something.
Thanks