Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for adding all watchers to a child issue upon creation

Uwe Pilz July 12, 2024

When creating a story for a parent epic or a subtask for a story I want that all watchers of that epic or story are automatically added to the child ticket.

I tried the following:

Bildschirmfoto 2024-07-12 um 17.28.17.png

I suspect though it only takes the first watcher - not all. How can I add all watchers?

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Champion
July 12, 2024

Hello @Uwe Pilz 

You can't create a Variable in a branch and then use it elsewhere. The Variable ceases to exist when the branch execution is completed.

Also, branches in Automation rules run in parallel, so you can have the actions of a branch depending on the actions of a branch listed earlier in the rule.

This is the rule you need.

Screenshot 2024-07-12 at 9.26.51 AM.pngScreenshot 2024-07-12 at 9.27.00 AM.pngScreenshot 2024-07-12 at 9.27.06 AM.png

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2024

Hi @Uwe Pilz 

Some fields of a parent issue are visible to the child, without any lookups.  That includes the watchers.

And, when adding the watchers from one issue to another, they can be added by referencing them directly.

Putting those together, you could simplify your rule to this:

  • trigger: issue created
  • action: re-fetch issue  (The issue created trigger can fire so quickly that some data may not be available to the rule yet.  To fix this, always add the re-fetch issue action immediately after this trigger.)
  • condition: parent is not empty
  • smart value condition:
    • first value: {{issue.parent.watchers}}
    • condition: does not equal
    • second value: leave this empty
  • action: manage watchers
    • add them with this: {{issue.parent.watchers}}

When you enter that smart value in the Add these watchers field, it will appear below the field.  Select it to use for the values.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events