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

Service Account Notification - need property details

rahul_p
Regular Contributor II
Regular Contributor II

Hi All,

We are triggering notification after creation of service account with details like account name, email etc.

We referred below document:

https://docs.saviyntcloud.com/bundle/EIC-Admin-v2021x/page/Content/Chapter06-EIC-Configurations/Crea...

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

 

 

10 REPLIES 10

SumathiSomala
All-Star
All-Star

@rahul_p did you try below variable?

SumathiSomala_0-1698224841714.png

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

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

@rahul_p 

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.

rahul_p
Regular Contributor II
Regular Contributor II

Hello @Dhruv_S ,

In this link also its giving same variable names which not working :

rahul_p_0-1698237161354.png

Thanks,

Rahul

rahul_p
Regular Contributor II
Regular Contributor II

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

 

@rahul_p 

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

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

rahul_p
Regular Contributor II
Regular Contributor II

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

Dhruv_S
Saviynt Employee
Saviynt Employee

@rahul_p 

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.

@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.

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

rahul_p
Regular Contributor II
Regular Contributor II

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

rahul_p
Regular Contributor II
Regular Contributor II

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