Summary: Need to loop through an issue's watchers; performing action on each watcher.
Algorithm:
I've attempted to use...
def wlist = getWatcherNames(issue.key); wlist.each() { watcherManager.stopWatching(it, issue.genericValue); }
... but receive the following error message:
"javax.script.ScriptException: groovy.lang.MissingMethodException. No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getWatcherNames() is applicble for argument types: (java.lang.String.values [MAIN-1234])"
Thanks so much for your help.
Community moderators have prevented the ability to post new answers.
What's getWatcherNames() - is that code defined elsewhere in your script?
I think you want something like:
def watcherManager = ComponentAccessor.getWatcherManager() def userUtil = ComponentAccessor.getUserUtil() watcherManager.getCurrentWatcherUsernames(issue).each { watcherManager.stopWatching(userUtil.getUser(it), issue.genericValue) }
(untested).
Hey Jamie, I'm trying to accept your answer as GOOD / ACCEPTED ANSWER, but am having trouble accessing the page if I'm signed in. If I sign in and click on the link (for this question), I get a server 500 error. If I access the page and then sign in, I can post a comment, but am unable to accept your answer as good. I created a ticket at https://jira.atlassian.com/browse/ANSWERS-610
Once I get this straightened out, I promise to accept your answer.
Thanks Jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie --- thanks so much, yet again for your help (I'm incorporating your answer into other work you helped me through).
I'm jealous that you were able to watch so many games at Highbury. The "Invincibles" season must have been amazing. Henry ruled the world.
Sincerely, Tyler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries Tyler ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Heh, don't worry, I think it's a known bug. But thanks for trying...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yo Jamie ------ I just incorporated your code into my project and, as always, you're code worked perfectly.
Thanks again! Good luck against West Brom on Sunday. And it's going to be fun watching Shaun Wright-Phillips get event with his former club.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was indeed a known bug. Should be fixed now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As if he needs more karma points..
Jamie, you should donate some to others ;)
Didnt know you were a Arsenal fan :)
I'm crossing everything that we finish 3rd in the league.
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.