06/08/2023 07:14 AM - edited 06/08/2023 08:03 AM
hello!
we have a problem:
How can i put endpoint owner group in an if-else condition in a workflow? the logic is like this:
IF (XYZ endpoint owner usergroup) creates a new account from ARS for externals approve ELSE reject.
I'm stuck in the usergroup part. I'm trying:
requestedby.usergroup.contains("XYZ")
but it's not working.
06/09/2023 01:05 AM
@Naz_A , I think you can use below check to see if the endpoint resource owner is the requestor or requestee
endpoints.requestowner eq user.id
endpoints.requestowner eq requestedby.id
endpoints.requestowner.contains(user.id) eq true
endpoints.requestowner.contains(requestedby.id) eq true
06/09/2023 01:18 AM
endpoint owner as a group should be the requestor, will try these and let you know!
Thanks
06/09/2023 01:47 AM
They are not working
06/12/2023 02:51 AM
You can use the below customquery in the customassignment block.
SELECT u.userkey
FROM
users u
WHERE
CASE WHEN
EXISTS (select userkey from usergroup_users where user_groupkey = '${endpoints.requestowner}' and userkey = ${requestedby.id})
THEN u.userkey = ${requestedby.id}
END
06/12/2023 05:20 AM - edited 06/12/2023 08:47 AM
Sadly it's not what we want. We want it to be an if else condition, this generates also an approval request which is not ideal.
06/12/2023 03:58 AM
User Groups are not exposed in workflow
06/12/2023 04:54 AM
the user group is also an endpoint owner, so I would go from endpoint owner side, if you have any ideas, please share!