Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

What is possible in Custom Action of User Update Rules ?

benjaminp
New Contributor
New Contributor

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

11 REPLIES 11

sahajranajee
Saviynt Employee
Saviynt Employee

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.


Regards,
Sahaj Ranajee
Sr. Product Specialist

Thank you @sahajranajee for your fast answer !

I have tried the SaviyntForSaviynt DB connector option :

  • I have provided an UpdateUserJson in the SaviyntForSaviynt connection (this query is for testing only) : {"updateUserQry":["update users set customproperty25= '${user.username}' where userkey = ${user.id}"]}
  • I have updated my User Update rule to run a User update task (with ExecuteOn : 0 days).

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.

 

Does this json works when you do normal access request? 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak 

I am testing this using "Create user request" and approving the request.

sahajranajee
Saviynt Employee
Saviynt Employee

Hi @benjaminp ,

This should work. Did you check logs to see if there was any error or issue?


Regards,
Sahaj Ranajee
Sr. Product Specialist

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}"]}

It will. Be great you post logs & share actual query as actual query might have issues or typos


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@rushikeshvartak 

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)

sahajranajee
Saviynt Employee
Saviynt Employee

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.


Regards,
Sahaj Ranajee
Sr. Product Specialist

Hi @sahajranajee 

Logs does not contain anything helpful I guess.

Regards

benjaminp
New Contributor
New Contributor

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