Metric definition for when an Incident goes from a "Resolved" state to "In Progress" (reopened)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 04:20 AM
I'm looking at creating a new metric definition to meet the below requirement:
- Incident table
- Records the date/time when an incident is reopened from a "Resolved" state. My observations is that an incident automatically goes into an "In Progress" state if reopened from a "Resolved" state.
This is the incident.state options from the Choice table:
Table | Element | Language | Value | Label | Hint | Inactive | Sequence |
incident | state | en | 1 | New | FALSE | 1 | |
incident | state | en | 2 | In Progress | FALSE | 2 | |
incident | state | en | 3 | On Hold | FALSE | 3 | |
incident | state | en | 6 | Resolved | FALSE | 6 | |
incident | state | en | 7 | Closed | FALSE | 7 | |
incident | state | en | 8 | Cancelled | FALSE | 8 |
This is my draft/pseudo script:
(function() {
if(current.state == 2) { //if current state is "in progress"
if(previous.state == 6) { //if prev state was "resolved"
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
if(mi.metricExists =() )
return;
var gr = mi.getNewRecord();
//stuck at this part. Want to create a metric instance that records the date/time the reoepen event occured for a particular incident.
Any help greatly appreciated!
0 REPLIES 0