The CreatorCon Call for Content is officially open! Get started here.

Metric definition for when an Incident goes from a "Resolved" state to "In Progress" (reopened)

SB87
Tera Expert

I'm looking at creating a new metric definition to meet the below requirement:

  1. Incident table
  2. 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:

TableElementLanguageValueLabelHintInactiveSequence
incidentstateen1New FALSE1
incidentstateen2In Progress FALSE2
incidentstateen3On Hold FALSE3
incidentstateen6Resolved FALSE6
incidentstateen7Closed FALSE7
incidentstateen8Cancelled FALSE8

 

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