How to Synchronize Watchers Between Parent and Subtasks
Asked by Kevin Hartley:

Trying to figure out a way to populate any changes in the watchers list of a parent ticket down to all of its subtasks. I'm not finding a trigger for if the watchers list is changed, though. The watchers list doesn't seem to be available. Any ideas?


Answers:
author: Ste Wright
body: Hi [@Kevin Hartley](/t5/user/viewprofilepage/user-id/3848581)

It's not possible (as far as I know) to trigger a rule based on watchers being modified. But it is possible to copy Watchers from a parent to its child issues.

You'll need to choose a different trigger. This is how I did it:

1. **Trigger:** Scheduled - run the rule once per day. Check "Run a JQL Search". Enter JQL relevant to your need - for example: *project = ABC and issuetype in standardIssueTypes() and watcher is NOT EMPTY*
2. **Branch:** For type of related issues, select Sub-tasks
3. **Action:** Manage Watchers - set "Add these watchers" to **{{parent.watchers}}** , and set "Remove these watchers" to **Remove all existing watchers (check the checkbox)**
4. Give the rule and publish it

This rule searches for issues that are not sub-task issue types and have at least one watcher.

The action will remove all existing watchers each time, and refresh them with the current watchers. This action could take place even if the watchers already match. It's important to remove the watchers though, otherwise you're just copying across newly added watchers - and removed watchers would be ignored.

**Note:**

* In the Trigger, there is a checkbox to "only include issues which have changed since the last time this rule was executed". You need to **uncheck** this as adding/removing Watchers does not class as an issue update!
* This rule could run across a large number of issues depending on the JQL, due to the removal and re-addition of Watchers. I would suggest running this at **project-level** - this is because global rules have an execution limit per month, based on your hosting type - but project rules have virtually unlimited executions!

Ste

comments: author: Kevin Hartley
body: Thanks, I figured I could use some sort of smart value with a daily check. I just wasn't sure if it was parent, or parentIssue or what. Is there a complete list of builtin smart value options, as I don't see parent in the documentation (I could also be overlooking it)? Also, thanks for the tip that adding/removing Watchers not counting as an issue update! Yeah, it looks like it is limited to 1000 issues even at the project level. I just needed to add a clause to the JQL query for issue status for my needs. Also don't want to remove watchers on the subtasks, so didn't include that part. Some subtasks might need specific watchers that the other subtasks and the parent don't need.


author: Ste Wright
body: Hi [@Kevin Hartley](/t5/user/viewprofilepage/user-id/3848581)

I'm not sure if there is a complete list of Smart Value options, the pages usually just come with examples!

There are ways to find most fields' smart values - see [this page](https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/) for help on how to do that in future :)

Ste


author: Christoph Winkler
body: [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) Thank you very much for providing this hint on a workaround for the not existing trigger (modification of watchers)

Do you know of an Issue/Feature about the missing trigger to vote on for the roadmap?


Tags: cloud