Assignment Group Metric

bekfro
Kilo Sage

Is it possible to modify the OOB assignment group metric to display a different value?  my goal  is to display the previous group along with the new group:

current.u_previous_assignment_group + ' -> ' + current.assignment_group.getDisplayValue();




1 ACCEPTED SOLUTION

AshishKM
Kilo Patron
Kilo Patron

Hi @bekfro ,

Yes, you can modify but best practice to copy the OOTB and update as per required logic. Keep the OOTP as it is.

This will help during the version upgrade to avoid any additional skipped update.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @bekfro ,

Yes, you can modify but best practice to copy the OOTB and update as per required logic. Keep the OOTP as it is.

This will help during the version upgrade to avoid any additional skipped update.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thanks AshishKM, i need assistance with the script to set the value to differently or I actually have a metric capturing the start time of the group changes but its not calculate the end and duration like the OOB field duration metric

createMetric();
function createMetric() {
  var mi = new MetricInstance(definition, current);
  var gr = mi.getNewRecord();
  if (current.u_previous_assignment_group=="")  {
	gr.start = current.sys_updated_on;  //calculate start of assignment based on updated value
	gr.value = current.assignment_group.getDisplayValue(); //assign the current assignment group , first group assignment
	gr.calculation_complete = true;
	gr.insert();
	}
else {
  gr.start = current.sys_updated_on; //calculate start of assignment based on updated value
//assign previous assignment group by concatening with the current assignment group , and use the value field
  gr.value = current.u_previous_assignment_group + ' -> ' + current.assignment_group.getDisplayValue();
  gr.calculation_complete = true;
  gr.insert();
	} 
}