PA report to check how many tickets came to particular group and how many passed to other group.

Balaji Prusty
Tera Contributor

Hi All;

 

I need to generate a PA report with the breakup of the assignment group, assigned etc. It should show how many tickets came to that group on that day and how many re-passed to another group from that group. 

 

I tried to build on the Incident metric table, but it gives only how many came to that group but is not able to find how many transferred to another group from that group.

 

Please help me here.

 

Thanks

Balaji

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @Balaji Prusty ,
I trust you are doing great.

  1. Create a new PA report in ServiceNow.
  2. In the report designer, add the Incident table as the data source.
  3. Add the relevant fields you want to include in the report, such as Assignment Group, Assigned, and any other fields you need.
  4. To get the count of tickets that came to a group on a specific day, you can use a filter condition to specify the desired date range. Example: [Opened] [is] [specific_date]
  5. To determine how many tickets were re-passed to another group from a specific group, you'll need to utilize the "Audit" functionality in ServiceNow. Here's an example code snippet to achieve this:

 

var gr = new GlideRecord('sys_audit');
gr.addQuery('document_key', 'incident');
gr.addQuery('field', 'assignment_group');
gr.addQuery('new_value', '!=', '');
gr.addQuery('old_value', '!=', '');
gr.addQuery('sys_created_on', '>=', gs.beginningOfToday());
gr.addQuery('sys_created_on', '<=', gs.endOfToday());
gr.query();

var groupCountMap = {};

while (gr.next()) {
    var oldGroup = gr.getValue('old_value');
    var newGroup = gr.getValue('new_value');

    if (!groupCountMap[oldGroup]) {
        groupCountMap[oldGroup] = {
            assigned: 0,
            repassed: 0
        };
    }

    if (!groupCountMap[newGroup]) {
        groupCountMap[newGroup] = {
            assigned: 0,
            repassed: 0
        };
    }

    groupCountMap[oldGroup].assigned++;
    groupCountMap[newGroup].repassed++;
}

 

  • After running the above code, you'll have a groupCountMap object that contains the counts of assigned tickets and re-passed tickets for each group. You can use this data to populate your PA report accordingly.

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Thanks, Amit for your Quick response.

 

My requirement is to generate the report in Analytics  Hub of the Performance Analytic module.  So the user can select the date and group from the breakdown to get the result. 

 

I think you provided the solution to generate in Normal report. How/where we can use the script in the report you mention to get from the audit table?

 

Thanks

Balaji Prusty

AndersBGS
Tera Patron
Tera Patron

Hi @Balaji Prusty ,

 

You can create separate metric definitions for actually capture what you would like in relation to assignment group inbound and outbound. Afterwards you can create a visualization in either PA or through report designer. 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/