Avoid Watcher Sync Errors by Excluding Forge App User

    Overview

    When synchronizing watchers between Jira Cloud instances, the synchronization may fail if the Exalate Forge application user is included in the watcher list.

    To avoid watcher synchronization errors, exclude the Forge app from the watchers during sync processing.


    Cause

    Exalate for Jira (Forge Extension)

    This is a system application account used by Exalate. When synchronization attempts to add this account as a watcher on the destination issue, Jira rejects the operation because the application user cannot be added as a watcher.

    As a result, the synchronization may produce an error similar to:

    Sync for remote item <issue-key> is blocked - Could not access issue tracker when performing action: Adding watcher to issue <issue-id>. Error(s): The user "<user-id>" does not have permission to view this issue. This user will not be added to the watch list.

    Solution

    To prevent this error, filter out the Forge application user before assigning watchers to the issue.

    Outgoing Sync (Jira Cloud)

    replica.watchers = issue.watchers

    Incoming Sync (Jira Cloud)

    def localWatchers = [] replica.watchers.each { w -> if (w.displayName == "Exalate for Jira (Forge Extension)") { return } def localUser = nodeHelper.getUser(w.key) if (localUser != null) { localWatchers << localUser } } issue.watchers = localWatchers

    Result

    After excluding the Forge application user:

    • Watchers synchronize without errors.

    • Only valid Jira users are added to the watcher list.

    • The synchronization completes successfully.