Highest number of incidents created
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 06:14 AM
Hello developers,
I need to get the highest number of incidents created by a particular person. Any help is appreciated, Thanks!
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 06:19 AM
Hi there,
And in what setting? Scripted? Something else?
You could query matching the particular person + the opened on and order by that date descending.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 06:27 AM
Refer to the below script.
var ga = new GlideAggregate('incident');
//var arr = [];
ga.addAggregate('COUNT', 'caller_id');
ga.groupBy('caller_id');
ga.query();
while (ga.next()) {
//arr.push(ga.getValue('caller_id'));
gs.print(ga.getDisplayValue('caller_id') + " has " + ga.getAggregate('COUNT', 'caller_id') + " incidents");
}
If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.
Thanks
dgarad
Thanks
dgarad