Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Workflow condition

asp
Regular Contributor
Regular Contributor

Hello,

We want to check if the user for whom the request is made, belongs to a specific user group and if so, then auto-approve the request. Otherwise send the request for approval by members of another workgroup (this part can be done with a custom assignment task). How do I set up the if else condition, to check if the user belongs to a specific workgroup?

Thank you

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Try the below code in the workflow if/else block. The language should be "groovy"

(com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select u.id from Users u,Usergroup_users ug where u.id=ug.userkey AND ug.user_groupkey=1 AND u.id='${requestedfor.id}'").size()!=0)

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

asp
Regular Contributor
Regular Contributor

Thank you! Where will the name of the usergroup specified in the query? 

asp
Regular Contributor
Regular Contributor

Thank you! Where will the usergroup name go in the above query? 

AmitM
Valued Contributor
Valued Contributor

ug.user_groupkey is key of the that user group. If you want to use name , join another table User_groups to the query

Hi @asp ,

You can provide key of your user group here in below query instead of group name.

(com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select u.id from Users u,Usergroup_users ug where u.id=ug.userkey AND ug.user_groupkey=1 AND u.id='${requestedfor.id}'").size()!=0) 


Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept As Solution to help other who may have a same problem. Give Kudos 🙂