getUserByEmail

    Note: If an instance has multiple users with the same email, getUserByEmail retrieves only the user who was created first.

    Signature

    Helper nodeHelper
    Signature
    getUserByEmail (String email)
    Description

    Return a user matching the specified email address.
    Returns a null in case:

    • the user email address is not found
    • the Exalate user has no 'Browse Users' permissions
    Introduced in 0.8

    Notes

    Jira Cloud

    Note: According to the Atlassian changes in user privacy policy, Jira Cloud users may hide the email address in the Atlassian account settings. This affects user fields synchronization since Exalate uses API to search by email. Therefore, make sure that the email is visible for the Exalate app in the Atlassian account.

    Azure DevOps

    Note: For the method to work on Azure DevOps, make sure that the user is part of the team that has access to the Azure DevOps project.

    Note: The Signature introduced in 0.8 works for Azure DevOps until version 5.4.0.

    For Azure DevOps 5.4.0 and higher

    Helper nodeHelper
    Signature

    getUserByEmail(String email, String projectName)

    Description

    Return a user matching the specified email address.
    Returns a null in case:

    • the user email address is not found
    • the Exalate user has no 'Browse Users' permissions
    Introduced in 5.4.0

    Example use

     //If the user exists set the custom field value to 'Yes', otherwise set the value to 'No'
    issue.customFields.internal.value = nodeHelper.getUserByEmail(replica.reporter.email) == null ? "No" : "Yes";

    Example use in Azure DevOps 5.4.0

    //If the user exists set the custom field value to 'Yes', otherwise set the value to 'No'
    issue.customFields.internal.value = nodeHelper.getUserByEmail(replica.reporter.email, issue.project.key) == null ? "No" : "Yes";