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 skip approval of the member who is requester and belongs to group in Group approval activity of workflow?

kushal6
Kilo Explorer

I want to skip approval of member in group who is also requester of request?

5 REPLIES 5

Or try below code inside function:

answer = ifScript();

function ifScript() {
var reqFor = current.variables.requested_for ; // replace with your value for requester for.

var gr = new GlideRecord('sys_user_grmember');

gr.addQuery('user', reqFor);

gr.addQuery('group','group sys_id');// here you can check if user is part of group you passed

gr.query();

if(gr.next()){

return 'yes';

}

else {

return 'no';

}

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade