Hello to all in the community
how can i remove all watchers from a ticket; actually iam trying this code, but its not working; i have imported all needed scripts correct; i get the watchers and need a way to search/find them in the usermanager. seems that there is my problem.
def watchers = ComponentAccessor.watcherManager.getWatchers(issue, english).getEmailAddress()
def userManager = ComponentAccessor.getUserManager()
def watcherManager = ComponentAccessor.getWatcherManager()
watchers.each{userName->
def user=ComponentAccessor.userManager.getUserByName(userName)
watcherManager.stopWatching(user, issue)
}