and more in a single search tool across platforms. Read the announcement here. |
01/31/2024 05:29 PM
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
Solved! Go to Solution.
01/31/2024 05:34 PM
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)
02/01/2024 08:32 AM
Thank you! Where will the name of the usergroup specified in the query?
02/01/2024 08:30 AM
Thank you! Where will the usergroup name go in the above query?
02/01/2024 08:58 AM
ug.user_groupkey is key of the that user group. If you want to use name , join another table User_groups to the query
02/01/2024 09:00 AM
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)