Approval notification based on the dynamic attribute selection

saipraveengv
New Contributor
New Contributor

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

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

attribute_oldValue

saipraveengv
New Contributor
New Contributor

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