How to get number of incidents raised by each user. And how many active users raised zero tickets?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 10:28 AM
How to get number of incidents raised by each user. And how many active users raised zero tickets?
Thanks.
Labels:
- Labels:
-
Incident Management
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 10:36 AM
I have just made this server side snippet, execute it as a Background Script (or any server side component) to check
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");
}
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', 'NOT IN', arr);
gr.addQuery('active', true);
gr.query();
while (gr.next()) {
gs.print(gr.name + " has 0 incidents");
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 10:40 AM
Hello,
Are you trying to get this by scripting or report?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 11:49 AM