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

CustomQuery to assign request for Rank 4 approval | Workflow

NishkalaPuli
New Contributor II
New Contributor II

Hi Team,

We have a requirement where there are set of users who are assigned as Rank 1 and Rank 4 approvers for entitlements. If one user who has approved the request for Rank 1, then the request must be redirected to other users for Rank 4 approval. 

To achieve this we have build a query, Validation looks good in Data analyzer but the request is getting assigned to admin when tested through workflow. Need assistance to get this fixed

select eo.userkey from entitlement_owners eo, users u where eo.entitlement_valuekey=${REQUESTACCESSOBJ.id} and eo.rank = 4 and u.userkey = eo.userkey and not eo.userkey in (select u.userkey from users u, access_approvers aa, request_access ra where ra.REQUEST_ACCESSKEY = aa.REQUEST_ACCESS_KEY and u.userkey = aa.APPROVEBY and ra.REQUESTKEY=${task.requestKey})

NishkalaPuli_0-1710831492921.png

 

 

4 REPLIES 4

CR
Regular Contributor III
Regular Contributor III

can you try below and confirm @NishkalaPuli 

select eo.userkey from entitlement_owners eo, users u where eo.entitlement_valuekey=${REQUESTACCESSOBJ.id} and eo.rank = 4 and u.userkey = eo.userkey and eo.userkey not in (select u.userkey from users u, access_approvers aa, request_access ra where ra.REQUEST_ACCESSKEY = aa.REQUEST_ACCESS_KEY and u.userkey = aa.APPROVEBY and ra.REQUESTKEY=${task.requestKey})


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

NishkalaPuli
New Contributor II
New Contributor II

@CR , It's the same, Still the request is getting assigned to admin.

NishkalaPuli_0-1710832977394.png

 

CR
Regular Contributor III
Regular Contributor III

try below

select eo.userkey from entitlement_owners eo, users u where eo.entitlement_valuekey=${REQUESTACCESSOBJ.id} and eo.rank = 4 and u.userkey = eo.userkey and eo.userkey not in (select u.userkey from users u, access_approvers aa, request_access ra where ra.REQUEST_ACCESSKEY = aa.REQUEST_ACCESS_KEY and u.userkey = aa.APPROVEBY and ra.REQUESTKEY=${ARSREQUEST.id})


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

NishkalaPuli
New Contributor II
New Contributor II

@CR It Worked, It was the binding Variable (${ARSREQUEST.id}). 

Thanks