Metrics with script calculation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 08:54 AM
Hi all,
I'm trying to create metrics to calculate 'Time between ticket creation and ticket closure' for a particular assignment group.
I've written the following code so far but the script doesn't work at all whatever the condition is.
From Subject Received Size Categories Andy Parimi FW: ServiceNow Metric Data 8:40 AM 40 KB

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:07 AM
FYI - Metrics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:12 AM
Yes. I've done some research on the same but i'm unable to figure out how to trigger the event using a business rule? What should be the condition in the BR?
Help appreciated. Thanks so much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:15 AM
You might want to add additional conditions like:
var s = current.incident_state;
if (s > 6)
otherwise the Metric will trigger every update as long as the group is IT-AppDeploy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:25 AM
Thanks Michael. The problem is, It is not triggered at all. Learned that i have to write a BR for it but not sure what it should include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:39 AM
The BR can contain your script, and the conditions would go into the conditions field.
Here is an example of how to write the BR: Re: Is there a way to report on audits in a way that is efficient (or a way to report on user action...