not authorized this script in background. if filters are applying this is working
var inc = new GlideRecord('incident'); inc.addActiveQuery(); inc.addQuery('priority','<=',2); // using operators inc.addQuery('short_description','CONTAINS','sap'); inc.query(); while (inc.next()){ gs.print(inc.number +''+ inc.short_description); } ...