PA: Formula Indicator with script calculation - HELP Needed

JR1
Tera Guru

hi all, 

 

I am trying to calculate the avg time it takes my Major Incident team to promote an incident after it gets proposed and I am not able to get my Formula Indicator to work.

 

The indicator widget aggregates by month avg+

 

Formula Indicator:  [[Summed duration of promoted Major incidents by MIM Team]]/[[Number of promoted major incidents by MIM Team]]

 

  1. Summed duration of promoted Major incidents by MIM Team - it aggregates by sum and contains the script calculation 

2. Number of promoted major incidents by MIM Team - count of accepted major incidents 

 

indicator source: promoted on today and promoted by the MIM team

 

here is the script and ANY help is much appreciated:

 

function calculateProposedToPromotedTime(proposed_on, promoted_on) {
if (proposed_on && promoted_on.getDisplayValue) {
    return diff(proposed_on, promoted_on) / (60 * 60 * 1000);
  } else {
    return 0; // Return 0 for incidents not meeting criteria
  }
}


 

0 REPLIES 0