using usergroup in if-else condition in workflows

Naz_A
Regular Contributor
Regular Contributor

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. 

7 REPLIES 7

shivmano
Regular Contributor III
Regular Contributor III

@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

Naz_A
Regular Contributor
Regular Contributor

endpoint owner as a group should be the requestor, will try these and let you know!

Thanks

Naz_A
Regular Contributor
Regular Contributor

They are not working

shivmano
Regular Contributor III
Regular Contributor III

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

shivmano_0-1686563374836.png

 

Naz_A
Regular Contributor
Regular Contributor

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. 

rushikeshvartak
All-Star
All-Star

User Groups are not exposed in workflow


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.

the user group is also an endpoint owner, so I would go from endpoint owner side, if you have any ideas, please share!