Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GlideAggregate
//Number of incidents varies depending on the current state
//of the incident table
var count = new GlideAggregate('incident');
count.addEncodedQuery('active=true');
count.addAggregate('COUNT');
count.query();
var incidents = 0;
if (count.next())
incidents = count.getAggregate('COUNT');
gs.info(incidents);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment