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

Custom assignment

Smiling
Regular Contributor
Regular Contributor

Greetings everyone,

I am working on use case,

When an enterprise role is requested for a role owner as the beneficiary, the approval should be sent to the other role owners in the group along with the beneficiary’s line manager.

For example: User1 is the role owner for role1. There are other role owners (User2, User3) to the role1. When role1 is requested for User1, the request should be sent for User2, User3 & User4(line manager of User1)

I want to know how to achieve this.

12 REPLIES 12

armaanzahir
Valued Contributor
Valued Contributor

Hi @Smiling 

Try using a custom query. something along the following lines for routing the approval to other role owners:

select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id} and userkey!=${user.id}

 

Workflow Components (saviyntcloud.com)

 

Regards,
Md Armaan Zahir

AmitM
Valued Contributor
Valued Contributor

Hi @Smiling , you need to do this in 2 steps if I have understood your ask correctly.

1) if else condition sample for ents (entitlement.getOwnerRank1().contains(user.username) eq true or entitlement.getOwnerRank1().contains(requestedby.username))

2)If above is true meaning this is user 1 , then use a custom assignment to get role owner and 

select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id} and (userkey!=${user.id} or userkey!=${RequestedBy})

3) If false - go to normal access approval block. 

Please feel free to change queries where needed but overall this is how you can structure the flow.

Best Regards,

Amit

Smiling
Regular Contributor
Regular Contributor

Hey Guys,

Thanks for your help but how's workflow going to look like.

rushikeshvartak
All-Star
All-Star

Query 

 

select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id} and userkey!=${user.id}
union select manager as userkey from users where userkey =${user.id} and ${user.id} not in (select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id})

 

rushikeshvartak_0-1708397083462.png

 


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

hey @rushikeshvartak,

After request is accepted by line manger it is escalating to admin not role owner, do you know why it is happening?

Share wf


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

hey @rushikeshvartak 

PFA WF

Smiling_0-1708581203979.png

 

I dont see any escalations in wf


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

I meant to say the request should go to role owners right, but it is going to admin IDK why?

Smiling_0-1708582297806.pngSmiling_1-1708582398284.png

 

naveenss
All-Star
All-Star

Hi @Smiling  There is a small typo in the query which is causing it to assign to admin. 

 

select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id} and userkey!=${user.id}
union select manager as userkey from users where userkey =${user.id} and ${user.id} not in (select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id})

 

The closing curly braces was missing in the above condition in the inner query. 

${REQUESTACCESSOBJ.id} 

Let me know if the above query helps!

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Smiling
Regular Contributor
Regular Contributor

hey Thanks for help

now requirement is, needed separate if else condition box where if request is raised for role owner then and only then it will go for custom assignment where if it is requested for role owner then except him request should go to other role owners.

select userkey from role_owners where rolekey=${REQUESTACCESSOBJ.id} and userkey!=${user.id}

Custom query block

If else 

role.getOwnerRank1().contains(user.username) eq true 

https://forums.saviynt.com/t5/community-knowledge-base/workflow-check-if-app-role-owner-is-submittin...


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