Workflow approval for entitlement2 based on entitlement owner1

BG_bullterier
New Contributor
New Contributor

Hello Saviynt gurus,

In ARS, the requestor can add three types of entitlements types, namely "Entitlement Type1" and "Entitlement Type2" , "Entitlement Type3." I need to create a custom query in the workflow to send an approval request for "Entitlement Type2 and 3" to the owner of selected "Entitlement Type1."

Request can contain many entitlements per type2.

Can you please provide your support in this matter?

Best regards.

11 REPLIES 11

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @BG_bullterier,

Please try the below query for ur use case,

SELECT
u.userkey
FROM
users u
WHERE
CASE WHEN EXISTS (
select
*
from
entitlement_values ev,
entitlement_types et
where
et.entitlementtypekey in (
< entitlement type 2 key >,< entitlement type 3 key >
)
and ev.entitlement_valuekey = ${REQUESTACCESSOBJ.id}
and et.entitlementtypekey = ev.entitlementtypekey
) THEN u.userkey IN (
select
userkey
from
entitlement_owners
where
entitlement_valuekey in (
select
ev1.entitlement_valuekey
from
entitlement_values ev1,
entitlement_types et1
where
et1.entitlementtypekey = < entitlement type 1 key >
and ev1.entitlement_valuekey = ${REQUESTACCESSOBJ.id}
and et1.entitlementtypekey = ev1.entitlementtypekey
)
) END


Thanks,

@sudeshjaiswal 

Thank you for your answer.

I replaced <entitlement type 1 key>, <entitlement type 2 key>, and <entitlement type 3 key> with the values for their respective entitlement types, which are '182', '183', and '193'. Unfortunately, the workflow (W-f) is not selecting 'entitlement owner 1' as an approver; instead, it is routing the approval to the ADMIN.

Do you have some idea what could be the reason?

thank you.

Hello @BG_bullterier 

Please first try with a simple 1 level workflow with custom assignment and query - 

select eo.userkey as userkey from entitlement_owners eo join users u on u.userkey=eo.userkey join entitlement_values ev on ev.entitlement_valuekey=eo.entitlement_valuekey where eo.rank=1 and ev.entitlementtypekey=182 and ev.entitlement_valuekey=${REQUESTACCESSOBJ.id}

Can you clarify if requirement is - if ALL entitlements selected in a request ( ex - ent1 from ent type1, ent 2 from entype2, ent 3 from entype3) be routed to Ent1 owner? then above query should work. 

Under your proposal, all entitlement types should be routed to the owner of entitlement type 1. However, currently, only approval for entitlement type 1 goes to the proper person, while entitlement types 2 and 3 are routed to administrators.

Hello @BG_bullterier,

Are you including entitlements from all three entitlement types in the request selection? The aforementioned query will indeed retrieve entitlements from all three types.

Thanks.

 

Yes, all 3 types are included in the request. Unfortunately your proposal routes to ADMIN only.

For Ent 2

if else block ${entitlementtypekey} = 182

Custom Assignment  select eo.userkey as userkey from entitlement_owners eo join users u on u.userkey=eo.userkey join entitlement_values ev on ev.entitlement_valuekey=eo.entitlement_valuekey where eo.rank=1 and ev.entitlementtypekey=182 and ev.entitlement_valuekey=${REQUESTACCESSOBJ.id}

hi @rushikeshvartak 

Proposal routes to Admin only.

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @BG_bullterier

Can you please confirm for Ent2, and Ent3 have the owner value in them?
And also make sure that any entitlement owner is not raising the request, in those cases, approval will route to admin.

Thanks,

Yes, it contains owner value in each entitlement type.

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @BG_bullterier,

Can you try hardcoding the "ev.entitlement_valuekey" in the above SQL query and check if it is getting assigned to the expected approved?

Thanks.