Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Auto Approve if the opened by is a member of a group?

praveenKumar2
Kilo Expert

I am looking for a way to auto approve a request if the opened by is a member of a group? Can someone help me how to code it!!!

Thanks.

pK

12 REPLIES 12

Well, you can use a workflow.scratchpad.   store the value true inside the loop and then call it within   the condition of   user approval..


Didnt get you...



Thanks,
pK


You have to use a if block, use the code :


var usr = new GlideRecord('sys_user_grmember');


usr.addQuery('user', current.opened_by);


usr.query();


if(usr.next()){


workflow.scratchpad.skip = 'true';


}





Then double click on the skipped path on the approval and in the condition write : workflow.scratchpad.skip == 'true';


No luck



Thanks,


pK


Please post some relevant scripts.. and place logs..