Adding watcher to subtasks

Andreas Wollenhaupt February 9, 2022

Hi,

i have the following rule:

- Scheduled

- Create a new Task

-> Branch "for most recentrly created issue"

->-> Create a new Subtask (A)

->-> And: Add Watchers (hans, frank, milo)

-> Branch "for most recentrly created issue"

->-> Create a new Subtask (B)


->-> And: Add Watchers (hans, julia, maria)

-> Branch "for most recentrly created issue"

->-> Create a new Subtask (C)

->-> And: Add Watchers (julia, maria, frank)

You'll get the idea. So for every subtask I have a different group of watcher that needed to be added to the subtask.

Currently Automation adding every Watcher to the "Main Task". It makes sense, but I can't find a different branch that is able to solve this.

Any ideas?

 

 

 

4 answers

1 accepted

4 votes
Answer accepted
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2022

I was able to do this in a single rule. The trick is to use one branch to create all the subtasks, and later branch to iterate over the new subtasks.

My rule adds the same watcher to all the subtasks, just to show that can be done.

@Andreas Wollenhaupt, for your case, you'll want conditionals in the second branch to identify each new story. I recommend comparing against the Subtask Summary field. That way you can customize the actions (different sets of watchers) for each Subtask.

Note that it's important to create the variable first BEFORE the branch. I just initialize it to "x". Then, in the first branch, I set it to {{issue.key}} for the newly created Story.

If the variable isn't initialized outside the branch, it will go out of scope at the end of the branch.

rule.png

__________________________________________ 

Audit Log.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2022

Clearly responded before my morning caffeine.  Yes @Mykenna Cepek has the better solution!

Like Mykenna Cepek likes this
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2022

@Mark Segall indeed it wasn't fair, as I had one coffee plus a half of a Monster energy drink onboard!

Like # people like this
Tyler Freeze November 4, 2022

 

Hi @Mykenna Cepek

What would change if you wanted to create multiple subtasks (let's say 5) and add different watchers to only a few of them (Watcher 1 to subtask 1 and watcher 2 to subtask 2 but no watchers on subtasks 3-5)?

0 votes
Tyler Freeze November 4, 2022

Hi @Mykenna Cepek

What would change if you wanted to create multiple subtasks (let's say 5) and add different watchers to only a few of them (Watcher 1 to subtask 1 and watcher 2 to subtask 2 but no watchers on subtasks 3-5)?

0 votes
Andreas Wollenhaupt February 14, 2022

Thanks for the tips. Gonna see what works.

 

Variables only exist in Cloud. :-/ Didn't know there is a difference.

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2022

Hi @Andreas Wollenhaupt 

You'll need to have a second automation rule for this because you would otherwise need a nested branch to dive into the newly created subtask which isn't possible.  The second rule should have the box checked for Allow Rule Trigger to ensure it triggers from the original rule

This one would look something like this:

  • TRIGGER: Issue Created
  • CONDITIONS
    • Issue Type = Subtask 
    • Any other distinguishing characteristics
  • ACTION: Add Watchers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events