Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/31/2022 08:19 AM
What is the variable that we can use for below scenarios:
1. Checking the account type in TO
Tried if(ServiceAccountOwnerMap!=null && ServiceAccountOwnerMap != 'null' && ServiceAccountOwnerMap != '' && !ServiceAccountOwnerMap.isEmpty() && ServiceAccountOwnerMap.get('ServiceAccountType') == 'Service Account') and account.accounttype=="Service account", but it didnot work
2. Sending the service account creation email to all owner
Tried
${ServiceAccountOwnerMap.get("ALL")?.collect{it.email}?.join(',')} and ${accountOwners.collect{it.email}.join(',')} but it did not work
3. fetching owner full name as a list (append firstname lastname and then join this list)
-directly we have variable ${ServiceAccountOwnerMap.get("ALL")?.collect{it.username}?.join(',')} nothing for getting first name last name in loop as we dont have a limitation on owners
Solved! Go to Solution.
05/31/2022 08:51 AM
06/01/2022 05:29 AM
account type check worked, thanks!
05/31/2022 10:33 AM
You can find the Service Account related binding variable information in below freshdesk documentation.
Regards,
Sagar Srikantaiah
05/31/2022 10:54 PM
For Email Templates, I have found the following very useful to know what variables are available, and what their type/values are, at the point in time where the email template is processed.
Add the following into an Email Template for debugging purposes:
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
06/01/2022 01:20 AM
ServiceAccountOwnerMap - this binding is usually used in approval/workflow emails and may not be available in task related email templates. You may want to explore the following expressions.
1. Checking the account type in TO
${if('Service Account'.equals(task?.accountKey?.accounttype)){ <<something>> } else {<<something>>}}
2. Sending the service account creation email to all owner - this is a little messy way, however should work for you.
${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}}
3. Fetching owner full name as a list (append firstname lastname and then join this list)
${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)?.username + ' :: ' + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.firstname + ' ' + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.lastname + '<br>';}; return res; } else{return ''}}