Encoded Query Not Working When Adding GOTO Date Condition

Aditya40
Mega Guru

 

Hi Community,

I'm trying to build an encoded query in GlideRecord that combines multiple conditions across sys_class_name, sys_updated_by, and a relative date filter. Here's the query:

 

 
gr.addEncodedQuery('sys_class_name=incident^ORsys_class_name=problem^sys_updated_by=javascript:gs.getUserName()^GOTOsys_updated_onRELATIVEGT@hour@ago@24');

The issue is that this query does not return any results, but if I remove the GOTO part, like this:

gr.addEncodedQuery('sys_class_name=incident^ORsys_class_name=problem^sys_updated_by=javascript:gs.getUserName()');

…it works fine.

I’m not sure if the problem is with how I’m using GOTOsys_updated_onRELATIVEGT@hour@ago@24 

, or if this is incompatible with GlideRecord.

Any insights or suggestions would be appreciated!

Thanks in advance.