Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

How to check current assignee in Workflow - If/Else condition

KT
New Contributor III
New Contributor III

In the workflow, once the request is assigned using Custom Assignment, how can we check who is the current assignee using If/Else condition?
Please let us know if you have any inputs. Thank you.

7 REPLIES 7

nimitdave
Saviynt Employee
Saviynt Employee

Where in the flow you want to check assignee?  In custom assignment block or you want to check assignee in the if-else block post the custom assignment block.

 

 

KT
New Contributor III
New Contributor III

We want to check the assignee in the if-else block post the custom assignment block. Basically, we need variables that we can use in the if-else block to check the assignee. We tried to use variable like ${assignee.email} but it was not working. Hence wanted to check if we can use any other variables in if-else block to check the assignee. Thank you.

KT
New Contributor III
New Contributor III

I also tried following binding variable but looks like it is not returning approver's user key as it is going to false condition of If-Else block. Can someone please correct if something wrong in the below expression?

com.saviynt.ecm.workflow.Access_Approvers.get(new Long(requestaccesskey))?.approverKey == 1234

Set groovy as expression language in the If-Else block and here 1234 is the approver's user key which is assigned in the custom assignment block. Thank you. 

nimitdave
Saviynt Employee
Saviynt Employee

${assignee.email} will not work in workflow if-else block.

Also assignee is evaluated only at the start of any approval block in the workflow and is nullified when the decision is taken on the approval item. So assignee cannot be checked while in if-else block.

But what is the use case you are trying to achieve here, may be we can suggest an alternative approach for the same.

KT
New Contributor III
New Contributor III

Thanks for your response.

Can you please confirm if anything incorrect in the below expression -
com.saviynt.ecm.workflow.Access_Approvers.get(new Long(requestaccesskey))?.approverKey == 1234

Use case: There are some exceptional scenarios where the request is not assigned to actual owners. Example - In case of an entitlement request which does not have active owners assigned at the time of requesting access then during the custom assignment, the request is assigned to one temporary owner who won't take any action on that request. Request will get escalated after some duration and again assign it back to the same custom assignment block where it will check and assign it to owners if valid owners are available. But before assigning it back to the same custom assignment block we wanted to check whether the request was assigned to the temporary owner or valid owners. If the request was assigned to valid owners then it will follow another path and won't assign it back to the earlier custom block.

KT
New Contributor III
New Contributor III

Please provide input if anyone has on this. Thank you.

nimitdave
Saviynt Employee
Saviynt Employee

The above expression will only provide data on evaluation when an approver has taken any action on it. The above will provide the key of approver who approved the item last in the flow.

You should assign the request to a resource who can take an action on it. That could be modifying existing approvers and then sending request to new approvers for approval.