Assignment Group in addEncodedQuery

Max Lin
Tera Contributor

I have the below script that runs well.

I would like to add in this 2 Assignment Groups 'is' and 'contains'

Thanks in advance! 

find_real_file.png

var count = new GlideAggregate('incident');
count.addEncodedQuery('active=true^assigned_toISNOTEMPTY');
count.addAggregate('COUNT');
count.groupBy('assigned_to');
count.query();  
while (count.next())
{
	gs.eventQueue('inc.rem','','',count.assigned_to.email,count.assigned_to.name+"|"+count.assigned_to.sys_id);
}
1 ACCEPTED SOLUTION

Robin Bakker
Kilo Guru

Hi Max,

You can right click on the filter and select "Copy Query", this will give you the code which you can use for the "addEncodedQuery". Don't forget to put an additional ^ in. 


find_real_file.png

If my answer has helped with your question, please mark it as correct and helpful.

Kr!
Robin

View solution in original post

2 REPLIES 2

Robin Bakker
Kilo Guru

Hi Max,

You can right click on the filter and select "Copy Query", this will give you the code which you can use for the "addEncodedQuery". Don't forget to put an additional ^ in. 


find_real_file.png

If my answer has helped with your question, please mark it as correct and helpful.

Kr!
Robin

Anshu_Anand_
Kilo Sage
Kilo Sage
gr.addEncodedQuery('assignment_groupLIKEIT ops-^ORassignment_group.name=IT helpdesk');

 

If its helpful mark answer as correct

Regards,
Anshu