REST Exception while Getting User by Username `null` on Jira Cloud

    Problem

    Error detail:
    javax.script.ScriptException: com.exalate.replication.services.api.issuetracker.rest.TrackerRestException: Rest exception while getting user by username `null` <br/>
    Response status code: 404 <br/>
    Response body: {"errorMessages":["Specified user does not exist or you do not have required permissions"],"errors":{}}

    Cause

    Changes to the Jira Cloud REST API related to the user privacy improvements caused by the Atlassian GDPR compliance.

    Check the deprecation notice and migration guide for major changes to Jira Cloud REST APIs to improve user privacy for more details.

    Solution

    • If you sync Users between Jira Cloud instances: replace the following line in the Sync rules 

      issue.reporter = nodeHelper.getUserByUsername(replica.reporter?.username)
      with this line
      issue.reporter = replica.reporter
    • If you sync Users between Jira Cloud and Jira on-premise: replace the following line in the Sync rules 

      issue.reporter = nodeHelper.getUserByUsername(replica.reporter?.username)
      with this line
      issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email)

    Note: We've used the reporter field for demonstration purposes. The solution also can be used to fix other User fields sync such as assignee, watchers, comment executor, etc.

    E.g. Replace the field for the assignee:

    issue.assignee = nodeHelper.getUserByUsername(replica.assignee?.username)

    with

    issue.assignee = replica.assignee