Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to report on the first Assigned To of Incidents

Rebecca_J
Tera Contributor

We need to get a report to know the first assigned person of Incidents.

I don't want to add any custom field for reporting purpose only.

I'd like to report based on incident_metric table.

 

I have a metric definition to capture the first assignment group which worked well with the following scripts:

 

      // variables available
     // current: GlideRecord - target incident
    // definition: GlideRecord - (this row)

if (current.sys_mod_count == 0) {
createMetric();
}

function createMetric(value) {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;

var gr = mi.getNewRecord();
gr.field_value = current.getDisplayValue('assignment_group');
gr.field = null;
gr.calculation_complete = true;
gr.insert();
}

 

 

I would like to have something similar.

I tried to follow the solution provided in this post, but it created a new metric instance every time the assigned to changes while I just need a new instance on the 1st assigned to person.

 

I'm not good at scripting.

Any suggestion please?

 

Thank you.

0 REPLIES 0