Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to Synchronize Watchers Between Parent and Subtasks

Kevin Hartley September 4, 2020

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?

1 answer

1 accepted

0 votes
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 5, 2020

Hi @Kevin Hartley 

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

Kevin Hartley September 8, 2020

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.

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2020

Hi @Kevin Hartley 

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 for help on how to do that in future :)

Ste

Christoph Winkler February 18, 2021

@Stephen Wright _Elabor8_  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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events