I’m looking to sync our Watchers field in Jira DC (on-prem) to our Jira Service Management instance (Cloud). Our Watchers include both internal and externals users in Jira DC but in JSM, I need these users to be added to Watchers (if internal) and Request Participants (if external).
I’m able to get all Watchers to Request Participants using this:
I’m not sure how best it would be to filter on the replica.watchers to create two collections or how to do an if statement to compare the email within the collect.
The following solution works for syncs between Jira instances, including a sync between Jira On-premise → Jira Cloud.
Place the following in Incoming Sync of your Jira Cloud.
def localWatchers = []replica.watchers.each { w -> def _localW = nodeHelper.getUserByEmail(w.email) if (_localW != null) { localWatchers << _localW // Add to the local watchers list if the user exists }}issue.watchers = localWatchers