How to get the array of issue watcher?

in my plugin i want to write a methode that enables me to return the array of issue watcher

i want to know if it is possible to get the array of watcher

if yes, i hope if somebody could help me with this

thanks in advance,

3 answers

1 accepted

This widget could not be displayed.
import com.atlassian.jira.issue.watchers.WatcherManager;

WatcherManager wm = ComponentAccessor.getWatcherManager();
List<String> watchers=wm.getCurrentWatcherUsernames(issue);

check this doc

https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/watchers/WatcherManager.html

excuse me rambanam but i want to have a coolection of users as this :

List<User> watchers;

This widget could not be displayed.

How about this:

import com.atlassian.jira.issue.watchers.WatcherManager;
import java.util.Locale;

WatcherManager wm = ComponentAccessor.getWatcherManager();
Collection&lt;User&gt; watchers = wm.getCurrentWatchList(issue, Locale.ENGLISH);

This widget could not be displayed.

excuse me rambanam but i want to have a coolection of users as this :

List<User> watchers;

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 9 hours ago in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

27 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you