How to get the first ever assignment group for a report?

Moedeb
Tera Guru

So I have a need to report on all incident tickets logged originally to the IT Service Desk, simple as if an incident was logged and the first assignment group was the IT Service Desk + 1 to the total count.

Now not all incidents are logged by the IT Service Desk, to the IT Service Desk assignment queue first up - they might have been logged through the portal and been assigned the the IT Service Desk, or logged directly by the IT Service Desk, both cases should have the IT Service Desk as the first assignment group.

I have a filtered report that uses the incident_metric table to look at if an incident was ever assigned to the IT Service Desk, but it doesn't tell me if it was originally assigned to them or not?

The filter is: (this looks at incidents not updated in the last 2 weeks and were ever assigned to the IT Service Desk)

Want just all incidents where first assignment group was IT Service Desk, no matter what the current state is, or where it is currently assigned.

Thanks in advance for the help.

 

1 ACCEPTED SOLUTION

amaradiswamy
Kilo Sage

Hi,

For this, you may follow any one of the below 

1. Create a script calculation type metric on incident table and assignment group field and write script to create a metric instance.

if (current.sys_mod_count == 0) {
 
  if (current.assignment_group == 'SYS_ID_OF_Service_DESK')
      value = true;
     
  createMetric();
}

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

  var gr = mi.getNewRecord();
  gr.field_value = 'IT Support';
  gr.field = null;
  gr.calculation_complete = true;
  gr.insert();
}

2. Create a field on incident table with name as "First Assigned Group" and create a before insert BR to update this field

View solution in original post

7 REPLIES 7

amaradiswamy
Kilo Sage

Hi,

For this, you may follow any one of the below 

1. Create a script calculation type metric on incident table and assignment group field and write script to create a metric instance.

if (current.sys_mod_count == 0) {
 
  if (current.assignment_group == 'SYS_ID_OF_Service_DESK')
      value = true;
     
  createMetric();
}

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

  var gr = mi.getNewRecord();
  gr.field_value = 'IT Support';
  gr.field = null;
  gr.calculation_complete = true;
  gr.insert();
}

2. Create a field on incident table with name as "First Assigned Group" and create a before insert BR to update this field

Thanks very much, used the Business Rule option and works a treat!

I am glad that it helped. Consider marking a reply as correct so that others looking for same may get benefited

Hi,

I tried to create a script calculation type as advised , but it is not returning any at all. Help?

 

find_real_file.png