This page provides information on using data, synchronized by Active Directory Attributes Sync app, in email templates.
To use user’s attributes from Active Directory in email templates, use in the velocity template the following code:
$!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject($customfieldKey).get("valueMap").get($connectionId).get("userAttr").get($userAttributeKey)
Variables needed for the phrase are listed below:
To get the attribute Telephone Number value from customfield [Deviniti] User’s attributes from Active Directory (AD) which value is customfield_10101, and for connection which id is equals 2, use the following expression:
$!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10101')).get("valueMap").get("2").get("userAttr").get("Telephone Number")
To get the attribute Department value from customfield [Deviniti] User’s attributes from Active Directory (AD) which value is customfield_10203, and for connection which id is equals 4, use the following expression:
$!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10203')).get("valueMap").get("4").get("userAttr").get("Department")
To extract and present user’s attribute in the velocity email template (HTML), use the following expression:
issueresolved.vm
Hi,</br>
Your issue $!issue.key has been resolved</br>
</br>
Best regards</br>
$!issue.assignee.displayName</br>
$!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10101')).get("valueMap").get("2").get("userAttr").get("Title")</br>
$!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10101')).get("valueMap").get("2").get("userAttr").get("Telephone Number")
If you can’t find the answer you need in our documentation, raise a support request.