Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/18/2024 10:33 AM
I am trying to use below query in Consult/Reassign query of Entitlement owner campaign configuration but it is not working?
select u from users u where 1=1 and (u.id in (select manager from users where id=:loggedInUser) or u.id in ((select distinct manager from users) and (select count(*) from com.saviynt.ecm.identitywarehouse.domain.user_savroles usr where usr.rolekey=1 and u.userkey=:loggedInUser)=1))
I just want to show the direct manager in pop-up when certifier tries to consult, but if any admin tries to consult they should see all managers from users table (usr.rolekey=1).
Is the usage of "com.saviynt.ecm.identitywarehouse.domain.user_savroles" table in correct format?
Thanks in advance
Solved! Go to Solution.
06/18/2024 10:37 AM
users table is not mapped
06/18/2024 10:42 AM
user_savroles is not exposed.
select u from Users u where 1=1 and (u.id in (select manager from Users where id=:loggedInUser) or (u.id in (select distinct manager from Users) and (select count(*) from com.saviynt.ecm.identitywarehouse.domain.user_savroles usr where usr.rolekey=1 and usr.userkey=:loggedInUser)=1))
06/18/2024 10:44 AM
What is the possible solution?
06/18/2024 10:45 AM
Use some user's customproperty to identify admin
06/18/2024 10:54 AM
Can we make any configuration to expose user_savroles table and utilize it in the query?
06/18/2024 10:58 AM - edited 06/19/2024 06:50 AM
select u from Users u where 1=1 and (u.id in (select manager from Users where id=:loggedInUser) or (u.id in (select distinct manager from Users) and (select count(*) from com.saviynt.ecm.identitywarehouse.domain.User_savroles usr where usr.rolekey=1 and usr.userkey=:loggedInUser)=1))
06/18/2024 09:54 PM
Hi @varunakarnia ,
Below are the exposed tables in backend. Use the same format.
Your query:
select u from Users u where 1=1 and (u.id in (select manager from Users where id=:loggedInUser) or (u.id in (select distinct manager from Users) and (select count(*) from User_savroles usr where usr.rolekey=1 and usr.userkey=:loggedInUser)=1))
If this answers your question, please consider selecting Accept As Solution and hit Kudos
06/19/2024 02:34 AM
Thank you very much, it worked.
Looks like it is strictly case sensitive. Appreciate your help