Add/Remove Watchers
You can choose to add or remove watchers on spaces, blogs, or content selected by CQL using this built-in script.
You can select both users and groups. For more information on users and groups, visit the Atlassian documentation Add users and set permissions.
Follow these steps to run the built-in script:
For Select By, enter what type of content you want to work with.
Your choices are:
Space
Choose if you want to work with watchers of a space. If you add users and/or groups, they are added as space watchers – not page watchers. If you select Space and remove users as watchers, they may still watch pages in the space.- Enter the space you want to work with for Target Space.
- Enter the groups you want to work with for Apply to Groups.
- Enter the users you want to work with for Apply to Users.
- For Action, select Watch or Unwatch to add or remove users.
Blog
Choose if you want to work with watchers of a blog.- Enter the blog you want to work with for Target Space.
- Enter the groups you want to work with for Apply to Groups.
- Enter the users you want to work with for Apply to Users.
- For Action, select Watch or Unwatch to add or remove users.
CQL
Choose if you want to work with wachers selected by CQL. When you select CQL, the user(s) and group(s) are added as page watchers.In CQL Query, enter your CQL statement.
For more information about using CQL, check out CQL Query Conditions and Using CQL.
Select Show Examples to see provided CQL queries. If you select one, the field auto-fills with the query.
The hit counter to the right of the field indicates how many results are returned by the CQL query you entered.
- Enter the groups you want to work with for Apply to Groups.
- Enter the users you want to work with for Apply to Users.
- For Action, select Watch or Unwatch to add or remove users.
Select Preview to view results, or select Run to apply the change.
- Users are only listed in the results if they have permission to view the selected content.
- If you add a user who was already watching the content, they are not listed in the results.
- If you try to remove a watcher that was not watching the content, they are not listed in the results.
Example
If you have a large Confluence instance with many different types of users, you may want to add watchers for certain content. Say you have an instance where each developer has a blog to keep track of notes for their work. If a developer decides to leave the company, they might want to add watchers to their blog and other work so coworkers can find notes about unfinished work. In this case, Ayla Matic (user name is amatic) will want to add Violet Burton (username is violetb) as a watcher to their blog, Ayla's Blog, and all pages created by them in the instance.
Follow these steps to add Violet to Ayla's content.
- Navigate to General Configuration > ScriptRunner > Built-In Scripts.
- Select Add/Remove Watchers.
- Choose Blog for Select By.
- Enter Ayla's Blog for Target Space.
- Enter Violet Burton for Apply to Users.
- For Action, choose Watch.
- Select Run.
The result message: - Navigate back to the built-in scripts page.
- Select Add/Remove Watchers.
- Choose CQL for Select By.
- For CQL, enter creator = amatic.
- Enter Violet Burton for Apply to Users.
- For Action, choose Watch.
- Select Run.
The result message:
Now that we have gone through adding Violet as a watcher to Ayla's blog and pages created by them, Violet is following all of Ayla's content to have access to their notes once they leave the company.