07/26/2023 07:05 AM
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.
07/27/2023 12:50 AM
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,
07/27/2023 03:21 AM - edited 07/27/2023 03:22 AM
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.
07/27/2023 08:49 AM
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.
07/28/2023 05:02 AM
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.
07/27/2023 09:33 AM
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.
07/28/2023 05:05 AM
Yes, all 3 types are included in the request. Unfortunately your proposal routes to ADMIN only.
07/27/2023 02:13 PM
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}
07/28/2023 05:19 AM
Proposal routes to Admin only.
07/30/2023 09:24 PM
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,
08/04/2023 01:14 AM
Yes, it contains owner value in each entitlement type.
08/04/2023 02:49 AM
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.