- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 02:59 AM
hello,
I have a requirement to create a report on incidents priority change
for this, I have created a metric definition that is on the priority field
initially, it was as field value duration but was capturing the newly created incidents too.
My requirement is that only those incidents should be captured for the priority is CHANGED, not the incidents which have the priority set during creation
here is the SS of what I have done
I'm not getting results
help will be really appreciated
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 01:06 AM
Guys exciting news, I found a way to do the same
here is the breakdown of the same
step1] create a metric definition on the priority field
- Navigate to Metric definitions (metric_definition)
- click on new
- choose a table as Incident
- choose type as field value duration
- choose field as Priority
step 2] Create a script include
- under system definition, navigate to script include and click on new
- give the appropriate name and paste the following code(note the name of SI will be different in your case)
- save
step 3] Create a report on the incident_metric table
- navigate to create a new inside report
- give title, choose table as incident_metric
- choose type as list
- choose filter as: definition is [your definition name create din first step] and sys_id(inc_sysid) is one of the
javascript: new (your Si name here followed with ()).(your function name inside SI followed with ())
(example: javascript:new ICgetMetricInstances().createMetric();)
Note: this will give you those incidents for which priority is changed actually
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 03:12 AM
Hi Gaurav,
Your condition in the if condition is invalid.
Please use below.
if(current.priority.changes()){
createMetric()
}
If my answer helps you in any way please mark it as correct or helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 03:18 AM
I see there was a Typo
however, changing to the one you gave also resulted in none
is my script missing something
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 01:06 AM
Guys exciting news, I found a way to do the same
here is the breakdown of the same
step1] create a metric definition on the priority field
- Navigate to Metric definitions (metric_definition)
- click on new
- choose a table as Incident
- choose type as field value duration
- choose field as Priority
step 2] Create a script include
- under system definition, navigate to script include and click on new
- give the appropriate name and paste the following code(note the name of SI will be different in your case)
- save
step 3] Create a report on the incident_metric table
- navigate to create a new inside report
- give title, choose table as incident_metric
- choose type as list
- choose filter as: definition is [your definition name create din first step] and sys_id(inc_sysid) is one of the
javascript: new (your Si name here followed with ()).(your function name inside SI followed with ())
(example: javascript:new ICgetMetricInstances().createMetric();)
Note: this will give you those incidents for which priority is changed actually