Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Update systemusername and email when there is a change in Firstname, Lastname

jdoma
Regular Contributor
Regular Contributor

Can anyone helps me to find a solution to rerun systemusername and email generation rules while User Update when there is a change in Firstname and/or Lastname. Am trying to use Generate User Email action from User Update rule but that is not generating any email for User.

10 REPLIES 10

ManishAcharya
Saviynt Employee
Saviynt Employee

There is no logic as such available which can rerun systemusername generation rule. You can write custom code which will have the logic to generate them again and update user using the API. Then this jar can be attached to custom action in user update rule.

jdoma
Regular Contributor
Regular Contributor

Thank you Manish for the time and response. If you have a sample code/doc on how to invoke the custom jar, please provide us. Am not getting even if I generate a systemusername using custom method, we need to perform the uniqueness check as well.

You need to use saviynt rest api to check if systemusername is already used or not 

https://documenter.getpostman.com/view/1797923/RWaLwo21?version=latest#ef353ccb-a040-4324-bd9f-de90f... 


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

Hello @jdoma,

You can have a user update Rule to check for FirstName or LastName update, and the action of rule would be a "Custom Action". 

You will have to provide a fully qualified classname and the method name to this Action

avinashchhetri_0-1666370584219.png

You will need to write a custom extension (jar). The output of this custom Action is a JSON  (String userJson) of the user which triggered this rule. You would need to parse the userJson and get the relevant information, for e.g. UserName, SystemUserName, FirstName,  LastName and whatever attributes you need.

You can then have your custom logic to generate a systemUserName validate it's uniqueness until you get a unique value.

Sample API call to check the uniqueness of the systemUserName

avinashchhetri_1-1666371409672.png

 

Once you have the unique systemUserName generated, you can use the updateUser API to update the systemUserName.

Sample API Call :

avinashchhetri_2-1666371610422.png

 

Once the systemUserName is updated, you can have another user update rule to propagate the changes to other downstream applications, if needed.

 

 

 

Regards,
Avinash Chhetri

Hello Avinash,

Could you please share any documentation link that how to do custom action external jar development such as interface to be implemented, method need to be implemented, how to upload to Saviynt and make of use it? 

I can see we can have custom action at workflow, user update rule and scheduled job custom external jar execution, but not sure how to start... if you could have a step by step instruction start from custom class development > jar packaging > upload to Saviynt > use it in workflow > use it in user update rule > use it in scheduled job, it would be great.

Thank you very much!

Refer some jar code

https://saviynt.freshdesk.com/support/solutions/articles/43000617127-third-party-access-governance-v...


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

@rushikeshvartak - Freshdesk link no longer works. Do we have the docs link for this? - https://saviynt.freshdesk.com/support/solutions/articles/43000617127-third-party-access-governance-v...

-Siva

Dave
Community Manager
Community Manager

Even I wasn't able to find an exact match for that article, but how about this one:
https://docs.saviyntcloud.com/bundle/TPAG-Guide-v23x/page/Content/Validation-Framework-for-Organizat...
Scroll to the bottom to find Validation Jars.

Harsha
Regular Contributor II
Regular Contributor II

Hi @jdoma,

We have a similar requirement, can I get a sample  code you added to generate systemusername?

Thanks,

Harsha 

Hemanath
Saviynt Employee
Saviynt Employee