Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/04/2024 01:25 AM
Hi everyone,
I'm trying to create a SAV Role, that allows users to send Update User Requests for a specific set of Users.
To be exact, they should fith the following HQL Query:
select a from Users a where a.customproperty1 = 'Saviynt' and (a.owner = '${users.username}' OR a.createdby = '${users.username}')
Unfortunately, every time I try top enter this i receive the following message:
Most of the query works, but I'm not able to use createdby, no matter, if I try to compare it with a static value or a variable, as depicted above.
Any idea how to achieve this?
Cheers 🙂
Solved! Go to Solution.
04/04/2024 03:14 AM
try like below
select a from Users a where a.customproperty1 = 'Saviynt' and (a.owner = '${users.id}' OR a.createdby = '${users.id}')
or
[{"for": "UpdateUserRequest","query":"select a from Users a where a.customproperty1 IN ('Saviynt') and (a.owner = '${users.id}' OR a.createdby = '${users.id}')"}]
04/04/2024 03:45 AM - edited 04/04/2024 03:46 AM
Hi @Raghu
The issue is not that it isn't working, but I can not even enter it, with the above error message, because of the highlighted part:
select a from Users a where a.customproperty1 = 'Saviynt' and (a.owner = '${users.username}' OR a.createdby = '${users.username}')
Besides that, the approach using the attribute ID will not work, as a.owner, as well as a.createdby are populated with the username, not the userid.
I tested it though (using JSON insted of HQL) and were not able to retrieve any records in Update User Request.
Cheers 🙂
04/04/2024 11:33 AM
Please share logs once you click on tile.
04/04/2024 11:25 PM
04/05/2024 12:58 AM
can you check instead of hql use json and try it
[{"for": "UpdateUserRequest","query":"select a from Users a where a.customproperty1 IN ('Saviynt') and (a.owner = '${users.id}' OR a.createdby = '${users.id}')"}]
04/05/2024 01:17 AM
Hi @Raghu
Same as above, it does not return any results, even though there should be several fitting ones.
04/05/2024 03:44 AM
@Murmur My assumptions is createdby attribute is not exposed here.
Anyways lets see if any other member has further opinion.
04/10/2024 09:50 PM
use createdBy B is capital
select a from Users a where a.customproperty1 = 'Saviynt' and (a.owner = '${users.username}' OR a.createdBy = '${users.username}')
04/11/2024 10:43 PM
Thanks @rushikeshvartak!
I was pretty confident that I tested that already.