- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:26 AM
What is the correct syntax for less than or equal to in g:evaluate? My code below doesn't seem to work and I couldn't find any documentation on Wiki regarding <=.
<g:evaluate var="jvar_high_priority">
var tasks = new GlideAggregate('u_tasks');
tasks.addQuery('assigned_to', gs.getUserID());
tasks.addQuery('state', 1);
tasks.addQuery('priority', '${AMP}lt=;', 3);
tasks.addAggregate('COUNT');
tasks.query();
var count = 0;
if (tasks.next())
count = tasks.getAggregate('COUNT');
</g:evaluate>
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:45 AM
Here you go
<g:evaluate var="jvar_high_priority">
var tasks = new GlideAggregate('u_tasks');
tasks.addQuery('assigned_to', gs.getUserID());
tasks.addQuery('state', 1);
tasks.addQuery('priority', 'IN', '1,2,3');
tasks.addAggregate('COUNT');
tasks.query();
var count = 0;
if (tasks.next())
count = tasks.getAggregate('COUNT');
count;
</g:evaluate>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:45 AM
Here you go
<g:evaluate var="jvar_high_priority">
var tasks = new GlideAggregate('u_tasks');
tasks.addQuery('assigned_to', gs.getUserID());
tasks.addQuery('state', 1);
tasks.addQuery('priority', 'IN', '1,2,3');
tasks.addAggregate('COUNT');
tasks.query();
var count = 0;
if (tasks.next())
count = tasks.getAggregate('COUNT');
count;
</g:evaluate>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:48 AM
ahh got it, thanks once again Abhinay!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:58 AM
Glad you got your question answered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2016 09:51 AM
tasks.addQuery('priority', '${AMP}lt=;', 3);
Your semicolon is in the wrong spot,
try:
tasks.addQuery('priority', '${AMP}lt;=', 3);