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

Approval notification based on the dynamic attribute selection

saipraveengv
New Contributor III
New Contributor III

HI Team,

I have a requirement to sent out approval notification to user based on the option selected during user enrollment. 

Ex: We have 10 different Hrs available and notification for HR approval should be sent only based on the HR selected during enrollment. I am able to fetch the HR records and display to user and save the selection to a property file. But How do i sent approval notification only to selected HR?

And also i am using below place holder in email

${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{(it.attributeName.toString().equalsIgnoreCase('companyname'))}.collect{it.attributeValue}}.toString().replace('[','').replace(']','')}</td> </tr><tr> <td>Business Unit</td> <td> ${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{(it.attributeName.toString().equalsIgnoreCase('customproperty12'))}.collect{it.attributeValue}}.toString().replace('[','').replace(']','')}

 

This is working fine for new users created and all the dynamic attributes are printed in the email but when the user gets modified, only the modified attributes are getting printed in the template.

 

Can you specify the place holder which can satisfy both the conditions?

 

Thanks in advance

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

attribute_oldValue


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

saipraveengv
New Contributor III
New Contributor III

Can you give a sample for attribute_oldValue.  And any idea on how to achieve approval notification based on dyn attribute selection?

Since you are pulling the value from request_access_attrss which will only hold the data that is coming from current request in your case only modified data. I don't think you can get the value from dynamic attributes which are not part of request. 

If you have saved the values of dynamic attributes to custom properties then you can use those as variables. Meaning if you copied DA1 value to user CP1 then you can use ${user.customproperty1} to pull that information in case of modify request. In template you can check if request is create or modify accordingly you can change the parameter. If create request then use same parameter you are using currently if modify then use user attributes.


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

saipraveengv
New Contributor III
New Contributor III

HI @sk  i tried to use if else condition but it is not working. 

Below is the error from logs

"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":"SimpleTemplateScript9363.groovy: 1: unexpected token: ).replace( @ line 1, column 3157.\n","stream":"stdout","time":"2023-03-28T12:56:18.666554449Z"}"
"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":" lue}}.toString().replace('[','').replace\n","stream":"stdout","time":"2023-03-28T12:56:18.66655708Z"}"
"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":" ^\n","stream":"stdout","time":"2023-03-28T12:56:18.666559875Z"}"
"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":"\n","stream":"stdout","time":"2023-03-28T12:56:18.666562513Z"}"
"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":"1 error\n","stream":"stdout","time":"2023-03-28T12:56:18.666565157Z"}"
"ecm-worker","2023-03-28T12:56:19.051+00:00","{"log":"\n","stream":"stdout","time":"2023-03-28T12:56:18.666567469Z"}"

 

Attached the sample template. let me how to add the values. this is for update user request