Hi. I’m in the process of converting our existing issues into JIRA issues using the REST API. Because the API automatically adds the user using the API as a watcher for imported (created) issues, and I only want “real” watchers, I’d like to remove the default watcher after the issue is created.
No matter what I do, neither IssueRestClient.unwatch() nor IssueRestClient.removeWatcher() do anything at all - the default watcher remains.
Is there any way, using the API, to remove a watcher? I will eventually have upwards of 10K issues, and I’d prefer not having to manually (albeit in bulk) remove the default watcher.
FWIW, IssueRestClient.getWatchers() returns the list of watchers, a single item including the user that created the issue. I’ve tried a number of things to no avail, including refreshing (re-reading) the issue before attempting to unwatch the issue.
final URI watcherURI = issue.getWatchers().getSelf(); issueClient.unwatch(watcherURI).claim();
P.S. The user in question is the JIRA account admin, so certainly has plenty of authority.