Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Create a Report for an Assignment group

Lucky1
Tera Guru

Hello all,

 

There is a requirement asked from my customer and below is the one:

He want us to create a report, like for an Incident if the Assignment group changes to 'Helpdesk' from some other group and if the reassignment count for Helpdesk is equal or more than 2, then we need show case them in the report.

 

So, I told him that, it can be done, but it is not advisable as it needs some scripting by glide recording Audit table and this causes system performance issues.

 

 

So, I just raised the question here, to check if there is any feasibility to achieve this?

 

Will the Performance ANalytics works here? If so, how?

 

 

 

Regards,

Lucky

6 REPLIES 6

Lakshmi888888
Kilo Guru

Hi @Lucky1 ,

Sure. Here's how you can do it using a Metric Definition without creating a custom field:

Step 1: Create a Metric Definition

  1. Navigate to Metrics > Definitions or (metric_definitions.list)
  2. Click New.
  3. Select Type = Field Value Duration.
  4. Set:
    • Table: Incident [incident]
    • Field: Assignment Group
    • Active: True
    • Name: Anything you prefer
  5. Save the record.

Step 2: Generate Metric Instances

Once the metric is active, ServiceNow will automatically create Metric Instance records whenever the Assignment Group changes on an Incident.

Step 3: Verify Metric Data

  1. Navigate to Metrics > Metric Instances.
  2. Filter by your Metric Definition.
  3. Open a few Incident records and change the Assignment Group to confirm Metric Instance records are being created.

Step 4: Build a Report

  1. Create a report on the Metric Instance [metric_instance] table.
  2. Filter:
    • Metric Definition = your Assignment Group metric
    • Value = Helpdesk (or the group you want to track)
  3. Group By:
    • Document (Incident)
  4. Aggregate:
    • Count

Step 5: Identify Incidents Assigned Multiple Times

Any Incident with a count of 2 or greater indicates that the Assignment Group was set to Helpdesk multiple times.

Important Note

Metric Definitions only collect data after they are activated. Historical Assignment Group changes that occurred before the metric was created will not be available unless they are already captured elsewhere.


Please mark this response as Helpful or Correct if it helped.

Chetna_Aggarwal
Tera Contributor

This requirement can be achieved without querying the sys_audit table directly.

ServiceNow already provides an OOB Reassignment Count field on the Incident table, which is maintained by the OOB Reassignment counter Business Rule on the Task table. The Business Rule increments the reassignment count when the Assignment Group changes.

For this specific requirement, I would recommend leveraging the existing OOB functionality rather than querying the audit table.

The requirement is:

If an Incident is reassigned to Helpdesk from another Assignment Group and the Incident has been reassigned to Helpdesk two or more times, show the Incident in a report.

Recommended Approach

Keep the existing OOB reassignment_count field for the overall reassignment count.

Additionally, create a custom integer field such as:

Helpdesk Reassignment Count

A small Before Update Business Rule can be created on the Incident table to increment this field when an Incident is reassigned to the Helpdesk group.

For example, the logic can identify transitions such as:

Network Team → Helpdesk       Helpdesk Count = 1
Helpdesk → Application Team
Application Team → Helpdesk  Helpdesk Count = 2
Helpdesk → Network Team
Network Team → Helpdesk       Helpdesk Count = 3

The report can then simply use:

Assignment Group = Helpdesk
AND
Helpdesk Reassignment Count >= 2

This approach is preferable to querying sys_audit every time the report runs and avoids unnecessary historical-table processing.

Performance Analytics Alternative

Performance Analytics can also be used if the requirement is intended to provide historical analysis and trends rather than only a list of qualifying Incidents.

ServiceNow provides an OOB Assignment Group metric, and the incident_metric database view can be used with Performance Analytics to analyze Assignment Group changes and reassignments.

With this approach, we could analyze:

  • Number of Incidents reassigned to Helpdesk
  • Number of unique Incidents reassigned to Helpdesk
  • Groups sending Incidents to Helpdesk
  • Reassignment trends over time
  • Incidents repeatedly moving between Helpdesk and other groups

Final Recommendation

For the immediate requirement of generating a report containing Incidents where Helpdesk has received the Incident two or more times, I would recommend:

OOB Reassignment Counter + a small custom Helpdesk-specific counter + standard report.

For broader management reporting and trend analysis, Performance Analytics using the OOB Assignment Group metric would be the better option.

I would avoid directly querying sys_audit for this use case unless there is a specific historical requirement that cannot be satisfied through the existing metric/reassignment functionality. ServiceNow community guidance also recommends using metrics rather than directly querying sys_audit for assignment-group history.