Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/08/2022 02:17 AM
Hi,
I need to, after a user is created or updated, do some user attribute modifications.
For that, I tried to used the "Custom Action" action of User update rule. I entered class name and method name, and I can see from logs that my Java method (from an external Jar) is called.
Now I am struggling with what I can do in my Java method.
So my question is : what can I do inside of the Java method to modifiy user attributes ?
I tried returning a User object serialized, but it does not seem to work. Do I have to call Saviynt API ?
Or maybe there is another way to do what I want (with something else than a custom action in a jar file).
Thanks in advance for your help !
Benjamin
Solved! Go to Solution.
08/08/2022 02:32 AM
Hi @benjaminp ,
Ideally to achieve your use case, you can use the SaviyntForSaviynt DB connector or use the Saviynt APIs to create a SaviyntForSaviynt REST connector and use the 'Create Update User Task' or 'Create Update Account Task' to achieve user attribute modification use case.
Now going back to Custom Action, The user update rule allows you to invoke a jar via Custom Action. The jar has to accept user details being sent as JSON and then the possibilities are endless from a perspective of what can be done.
For your use case, you would be calling the Saviynt REST APIs in the jar to update the user attributes. but you can also achieve this via a REST connection created based on on the APIs.
08/08/2022 03:09 AM
Thank you @sahajranajee for your fast answer !
I have tried the SaviyntForSaviynt DB connector option :
After creating a user, the rule runs and the Update user task is created. When completing the task, nothing happens on the user.
Is their something missing in my configuration ?
Note : this query is only for testing purpose.
08/08/2022 04:17 AM
Does this json works when you do normal access request?
08/08/2022 04:46 AM
I am testing this using "Create user request" and approving the request.
08/08/2022 04:15 AM
Hi @benjaminp ,
This should work. Did you check logs to see if there was any error or issue?
08/08/2022 04:45 AM
Hi @sahajranajee ,
I've looked in the logs and I haven't find any error or issue (even though I am not sure what to look for).
Here is my complete UpdateUserJson in case it can help :
{"updateUserQry":["update users set customproperty25= '${user.username}' where userkey = ${user.id}"]}
08/08/2022 04:46 AM
It will. Be great you post logs & share actual query as actual query might have issues or typos
08/08/2022 04:49 AM
The whole updateuserjson is {"updateUserQry":["update users set customproperty25= '${user.username}' where userkey = ${user.id}"]}
For logs, what do you want exactly ? I'm on v2021.0 so I can only download 1000 records and there are a lot of logs (maybe a keyword)
08/08/2022 04:52 AM
Hi @benjaminp ,
run the provisioning job,then go to logs module, filter on ecm-worker service and get logs.
ecm-worker is the service where jobs are executed.
08/08/2022 05:28 AM
08/08/2022 09:22 AM
I found the error, I was misstyping systemeusername (it is user.systemUserName and not user.systemusername).
Thanks a lot for your help @sahajranajee and @rushikeshvartak !
Regards
Benjamin