Work with Watchers
Add and remove watchers on Jira issues using HAPI, with code examples for each operation.
Add a watcher to an issue
Add a watcher to an issue as follows:
Issues.getByKey('SR-10').addWatcher('jdoe')Remove a watcher from an issue
Remove a watcher from an issue as follows:
Issues.getByKey('SR-10').removeWatcher('jdoe')Retrieve the watchers from an issue
Retrieve watchers from an issue as follows:
Issues.getByKey('SR-10').watchersSecurity
By default all watcher operations respect the permissions of the current logged in user. You may want to ignore permission checks with the overrideSecurity property:
Note: In this example we're using the
overrideSecurity property to ignore permission checks when adding a watcher to an issue.Issues.getByKey('SR-10').addWatcherOverrideSecurity('jdoe')