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

Check if requestor or requestee is single entitlement owner in workflow

SUMAIYA_BABU
Regular Contributor
Regular Contributor

In a workflow, I need to check if the item being requested(entitlement/role) has only a single owner and if that owner is requestor or requestee. Is this possible?

8 REPLIES 8

CR
Regular Contributor III
Regular Contributor III

@SUMAIYA_BABU 

We can check try below condition:

entitlement!=null and entitlement.getOwnerRank1().size() > 0


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

SUMAIYA_BABU
Regular Contributor
Regular Contributor

I need to check if the entitlement has one owner only and whether owner is either requestor or requestee

Use if else with groovy block

(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='${dynamicAttributesReqAccess.get(requestaccesskey).get('USERGROUPOWNERKEY')}' AND u.id='${requestedby.id}'").size()!=0)

 Above is sample


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

Manu269
All-Star
All-Star

Check this post : Solved: User group is not working as expected in if else b... - Saviynt Forums - 64590

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

SUMAIYA_BABU
Regular Contributor
Regular Contributor

@rushikeshvartak @Manu269 

I modified the query to below to fit out requirement

(com.saviynt.ecm.identitywarehouse.domain.entitlement_owners.executeQuery("select u.id from Users u,entitlement_owners eo where u.id=eo.userkey AND (u.id='${requestedby.id}' or u.id='${requestedFor.id}'"))

Looks like this is not working. I see the below error

stdout F de.odysseus.el.tree.TreeBuilderException: Error parsing '#{((com.saviynt.ecm.identitywarehouse.domain.entitlementslist.get(requestaccesskey)_owners.executeQuery("select u.id from Users u,entitlementslist.get(requestaccesskey) eo where u.id=eo.userkey AND u.id='${requestedby.id}'").size()!=0)) eq true }': syntax error at position 83, encountered '_owners', expected ')'

 

Tried with 

(com.saviynt.ecm.identitywarehouse.domain.Entitlement_values.executeQuery("select u.id from Users u,entitlement_owners eo where u.id=eo.userkey AND (u.id='${requestedby.id}' or u.id='${requestedFor.id}'"))


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

chitraca
Saviynt Employee
Saviynt Employee

Could you do something like this:

 

chitraca_0-1709685787304.png

The first condition checks if there is an entitlement in the request. The second condition checks that there are no owners on the first 3 ranks of the entitlement.  The 3rd condition checks that there is only one owner on Rank1 and the other 2 ranks are empty and the Rank1 owner is either the requestor or the requestee.

SUMAIYA_BABU
Regular Contributor
Regular Contributor

Hi Chitra,

I was able to get it working using the below query:

entitlement ne null and entitlement.allowner.size() eq 1 and (entitlement.allowner.contains(requestedby.username) or entitlement.allowner.contains(user.username))