Apps documentation
Active Directory Attributes Sync
Active Directory Attributes Sync
Guides
FAQ
Release notes
Last updated Jul 20, 2017

Using synchronized data in notification

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 e-mail 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:

  • $customfieldKey - key of the custom field of the type [Deviniti] User’s attributes from Active Directory (AD).
  • $connectionId - id of Active Directory or LDAP server connection (to check it, go to the Add-on > Active Directory Attributes Sync > Connections - section Details).
  • $userAttributeKey - key of the user attribute in Jira, for example: ‘Telephone Number’, ‘Department’, ‘Title’, etc.

Examples

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")