How can we skip the approval if that group has no members

nikhitha24
Tera Guru

Hi All,

 

Can someone please help me on the below requirement.

 

I have write a script to trigger the approval based on the CI selected on change request. i have 3 custom field based on the ci selected it should check groups from that fields and trigger approval.

How i we set that if the selected group has no member, it won't pass the approval it will go for next.

 

 

nikhitha24_0-1692709383237.png

nikhitha24_1-1692709412487.png

I have set the condition for approved and reject.

nikhitha24_2-1692709478785.png

 

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhitha24 

you need to use custom action and check this and return true/false.

then use IF action and check if it's true or false and based on that go for approval

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sandeep Rajput
Tera Patron
Tera Patron

@nikhitha24 Inside your Approval action, GlideAggregate sys_user_grmember table with your group sys_id and check if the count is greater than zero. If count is greater than zero than you can send the approval request otherwise you can proceed with the next step.