I'm totally new to JIRA and Groovy too. I'm looking for a script which can fetch the Group from a custom filed and add to watchers list. Can someone help me with that?
To expand and help a bit on Nic's answer here is another question that has an answer from @Michal Orzechowski that I found helpful as well. I didn't creat anything yet but I hopefully will. If I get smothing that works Ill post it here as well.
The other Answers questions that has some good dev links in it to specifics.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have a look at the script-runner documentation really, as I'd encourage you to learn for yourself (and I've not written anything similar yet)
However, I'd think you'll need something like
import
com.atlassian.jira.user.ApplicationUsers
def
watcherManager = componentManager.getWatcherManager()
for
(user in listUsers) {
watcherManager.startWatching(user issue.getGenericValue())
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't.
A group is a group, a watcher is a user. The two objects are incompatible.
The best you can do is get the group, iterate through all the members to get the individual users and add each individual as a watcher - will that be good enough?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Thanks for the information. Yes, your suggestion will be goog enough for me. Thank you!
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.