Skip to content

Instantly share code, notes, and snippets.

@wave-inguane
Created August 3, 2021 21:48
Show Gist options
  • Save wave-inguane/8ce186133abd7469043080714d6fedea to your computer and use it in GitHub Desktop.
Save wave-inguane/8ce186133abd7469043080714d6fedea to your computer and use it in GitHub Desktop.
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