isUserAssignable

    Signature

    HelpernodeHelper
    SignatureisUserAssignable (projectKey String, user IHubUser/ accountId String)
    Description

    Check if the user can be assigned as a reporter/assignee/other user fields. Usually used to avoid errors when syncing users between instances.

    Introduced in4.6

    Example use

    Set the issue assignee to the remote assignee only if it can be assigned in that project

    def assignee = nodeHelper.getUserByEmail(replica.assignee?.email)
    if(nodeHelper.isUserAssignable(issue.projectKey, assignee)){
        issue.assignee = assignee
    }else{
        issue.assignee = nodeHelper.getUserByEmail("default@admin.com")
    }

    Set the issue assignee to the remote assignee only if it can be assigned in that project

    def remoteAssignee = nodeHelper.getUserByEmail(replica.assignee.email)
    if (nodeHelper.isUserAssignable("TEST", remoteAssignee) {
         issue.assignee = remoteAssignee
    }