Simplifying Glide Aggregate - Real use cases & Scripts - II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2025 09:58 AM
Real-World Scenarios Using
GlideAggregate:-
6. Minimum Updates by Category
var count = new
GlideAggregate('incident');
count.addAggregate ('MIN',
'sys_mod_count');
count.groupBy('category');
count.query();
while (count.next()) {
gs.info("Category: " +
count.category + " | Min Updates: " + count.getAggregate ('MIN', 'sys_mod_count'));
}
7.Quarterly Incident Trends
var ga = new GlideAggregate('incident');
ga.addAggregate ('COUNT');
ga.addTrend('opened_at', 'quarter');
ga.query();
while (ga.next()) {
gs.info("Quarter: " +
ga.getValue('timeref') + " | Incidents: " +
ga.getAggregate ('COUNT'));
}
8.Category-Wise Incident Distribution
var count = new
GlideAggregate('incident');
count.addQuery('active', 'true');
count.addAggregate ('COUNT',
'category');
count.query();
while (count.next()) {
var category = count.category;
var categoryCount =
count.getAggregate ('COUNT', 'category');
gs.info("Category: " + category + " |
Count: " + categoryCount);
}
9.Count Active Software Incidents
var count = new
GlideAggregate('incident');
count addEncodedQueryl'activestrue').
count.addQuery('category=software');
count.addAggregate ('COUNT');
count.query();
if (count.next()) {
gs.info("Active Software Incidents: " + count.getAggregate ('COUNT'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2026 08:40 AM
Hi @Nilay_Potdukhe,
thank you for sharing your experience, however the formatting a bit undermines the whole effort... honestly I don't understand what you tried to say... perhaps some context around and formatting into some better readable form could make it more understandable
No AI was used in the writing of this post. Pure #GlideFather only
