ITSM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 06:16 AM
Hello,
script to get the list of incident number according to all category .
Can anyone help?
Thanks in advance
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 07:04 AM - edited 04-22-2025 07:06 AM
Hello @SomyaG
var incidentGR = new GlideAggregate('incident');
incidentGR.addNotNullQuery('category');
incidentGR.groupBy('category');
incidentGR.query();
while (incidentGR.next()) {
var category = incidentGR.getValue('category');
gs.print('Category: ' + category + '\n');
var incGR = new GlideRecord('incident');
incGR.addQuery('category', category);
incGR.query();
while (incGR.next()) {
gs.print(' - ' + incGR.getValue('number'));
}
}
Hope that helps!