The CreatorCon Call for Content is officially open! Get started here.

jelly syntax for less than or equal to

yundlu316
Kilo Guru

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>

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

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>


View solution in original post

5 REPLIES 5

Abhinay Erra
Giga Sage

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>


ahh got it, thanks once again Abhinay!


Glad you got your question answered.


ahaz86
Mega Guru

tasks.addQuery('priority', '${AMP}lt=;', 3);



Your semicolon is in the wrong spot,



try:


tasks.addQuery('priority', '${AMP}lt;=', 3);