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)
}
Hi, @Markus W_ BENES
Try this code please:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.