How to get the number of open tickets assigned to the current assignment group and have to display a message

Akhil Maan1
Tera Contributor

Hi,

How to get the number of open tickets assigned to the current assignment group and have to display a message like-"The assignment group has (this number of)tickets open"?

Regards,

Akhil

3 REPLIES 3

Community Alums
Not applicable

Hi @Akhil Maan ,

I would recommend you to cerate a report.

Refer to this thread: https://community.servicenow.com/community?id=community_question&sys_id=8805cb2ddbd8dbc01dcaf3231f96...

and this video :

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep,

Thank you for your response,

when I assigned a ticket to a group then in the form of alert I want to show an alert like these ticket are pending on this group.

Regards,

Akhil

Abhijit4
Mega Sage

Hi Akhil,

You can write display BR and use below script and configuration to show message on form,

BR script : 

find_real_file.png

BR configuration:

find_real_file.png

Script for your reference:

var ga = new GlideAggregate("incident");
ga.addQuery("assignment_group", current.assignment_group);

//add here state=pending filter
ga.addAggregate("COUNT", "assignment_group");
ga.query();
if (ga.next())
gs.addInfoMessage(ga.getAggregate("COUNT", "assignment_group"));

Note :change table name if it is not for incident table and add state=pending filter to show only pending ticket count.

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP