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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,895
Community Members
 
Community Events
176
Community Groups

Adding watcher to subtasks

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

3 votes
Mykenna Cepek Community Leader Feb 09, 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 Feb 09, 2022

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

Like Mykenna Cepek likes this
Mykenna Cepek Community Leader Feb 09, 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

 

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)?

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)?

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 Feb 09, 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

Atlassian Community Events