Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/01/2024 03:07 AM
Hi Team -
I am currently using the below custom assignment query to send approval to SOD risk owner for requests where there is SOD conflict identified. This is working as expected but when the Requestor is the SOD risk owner, then the request is getting assigned to IAM admin user. Can someone please advise how this can be handled. I would like for this to be autoapproved.
select u.userkey
from request_exceptions RE INNER JOIN riskowners RO ON RO.RISKID=RE.EXCEPTIONKEY
INNER JOIN Users U ON U.userkey=RO.OWNERUSERKEY
where RE.REQUESTKEY=${ARSREQUEST.id}
I have tried to use the below customquery but still the request is getting assigned to Admin when requestor is the risk owner
SELECT u.userkey
FROM
users u
WHERE
CASE WHEN
EXISTS (select us.userkey from request_exceptions RE INNER JOIN riskowners RO ON RO.RISKID=RE.EXCEPTIONKEY INNER JOIN Users us ON us.userkey=RO.OWNERUSERKEY where RE.REQUESTKEY=${ARSREQUEST.id} and us.userkey = ${requestedby.id})
THEN u.userkey = ${requestedby.id}
ELSE
u.userkey in (select us.userkey from request_exceptions RE INNER JOIN riskowners RO ON RO.RISKID=RE.EXCEPTIONKEY INNER JOIN Users us ON us.userkey=RO.OWNERUSERKEY where RE.REQUESTKEY=${ARSREQUEST.id})
END
Thank you