Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/25/2023 01:44 AM - edited 10/25/2023 01:49 AM
Hi All,
We are triggering notification after creation of service account with details like account name, email etc.
We referred below document:
When we used property like ${ACCOUNTNAME} or ${accounts.name}, getting below error in logs :
ERROR services.ArsTaskService - Error while sending email - No such property: accounts for class: SimpleTemplateScript8002
No such property: accounts for class: SimpleTemplateScript
Error while sending email - No such property: ACCOUNTNAME for class: SimpleTemplateScript
No such property: ACCOUNTNAME for class: SimpleTemplateScript
So is this document updated? Because it seems this document does not have proper property values. Can anyone share appropriate documentation?
Thanks.
Regards,
Rahul
Solved! Go to Solution.
10/25/2023 02:08 AM
@rahul_p did you try below variable?
Also you can use below line in email to identify the variable you can use
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
10/25/2023 03:31 AM
You can use the script suggested above to check the binding variables. Also you can check the supported binding variables from help section in the email template.
The document you are referring is for v2021x. You can refer to the below document for 23.x version.
Creating and Managing Email Templates (saviyntcloud.com)
Regards,
Dhruv Sharma
If this reply answered your question, please accept it as Solution to help others who may have a similar problem.
10/25/2023 05:33 AM
10/25/2023 05:35 AM
Hello @SumathiSomala ,
${account.name} not working with error which I mentioned in description.
How can I use the line which you mentioned? is there any document for that?
Regards,
Rahul
10/25/2023 05:39 AM - edited 10/25/2023 05:40 AM
Please use below code in email body & check variables available in particular Trigger .
Once the email triggered it will show list of supported binding variables.
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
10/25/2023 05:58 AM - last edited on 10/25/2023 06:08 AM by Sunil
Hello @SumathiSomala ,
Thank you for your reply.
tasktype = New Account
manager = <value>
accountOwners = [<value>]
randompassword = **************
entitlement = []
users = <value>
requestor = <value>
out = java.io.PrintWriter@76cb882a
account_password = **************
task = <value>
accountname = <value> Password - ************
requestid = ********
endpointDisplayName = <value>
account_name = <value>
requestormanager = <value>
baseUrlForEmail = https://removed.saviyntcloud.com/ECM
user = <value>
taskaction = New Account
account = <value>
We need to send this to service account owner, but that value is not there, so we can not send this to service account owner?
Also, we have a dynamic attribute called as email, we want to show that value as well.
Please comment.
Thanks,
Rahul
10/25/2023 06:57 AM - edited 10/25/2023 06:57 AM
Please use the variable ${account_name}
Regards,
Dhruv Sharma
If this reply answered your question, please accept it as Solution to help others who may have a similar problem.
10/25/2023 07:36 AM
@rahul_p please try with below variables
${account_name}
${task.accountName}
If this reply answered your question, please accept it as Solution to help others who may have a similar problem.
10/26/2023 01:12 AM
Hello @SumathiSomala @Dhruv_S ,
We need to send this to service account owner email, but that email value is not there, so we can not send this to service account owner email?
Also, we have a dynamic attribute called as email, we want to show that value as well.
Please comment.
Thanks,
Rahul
10/26/2023 03:55 AM - edited 10/26/2023 03:58 AM
Hello ,
For dynamic attribute use below :
${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('accttype')}.collect{it.attributeValue}}.get(0).join(', ')}
or
${task?.equestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('accttype')}.collect{it.attributeValue}}.get(0).toString().replaceAll('\\[','').replaceAll(']','')}
or
${String.valueOf(task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('accttype')}.collect{it.attributeValue}}.get(0)).replaceAll('\\[','').replaceAll(']','')}
To get the account owner email, use below :
${if('Service Account'.equals(task?.accountKey?.accounttype)){ def res = ''; task?.requestAccessKey?.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('USEROWNERKEY')}.collect{it.attributeValue}.join('###')}?.get(0)?.split(',')?.eachWithIndex{ num, idx -> res = res + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.email + ',';}; return res; } else{return user?.email}}
To get what variable are present to use in email template, check using below expression by putting in body, it will print all variable name with values and then accordingly you can use it :
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
Thanks,
Rahul