How to add a watcher to a sub-task in Jira Automation?

Leon Gumba October 28, 2024

Hello!

I am creating a scheduled automation rule that creates a task in my project, and I need to create a sub-task for it right from the start. I want one of my colleagues to be added as a watcher, but only for that specific sub-task, not for the parent issue.

How can I achieve this? I can't create a nested branch (branch within another branch), and when I try to add a branch for sub-tasks, I get this error:

"This component may be incompatible. One of the following needs to be produced earlier in the rule by the trigger or with a 'for each' branch for this component to work: Issue."

Any idea how to work around this?

Screenshot 2024-10-28 134624.png

2 answers

1 accepted

2 votes
Answer accepted
Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 28, 2024

Hi @Leon Gumba  You can change the Branch by selecting the Children option or you can use the JQL option.

Leon Gumba October 28, 2024

Hi @Manoj Gangwar , and thank you for your response!

Unfortunately, the Children branch option also produces the same error.

Screenshot 2024-10-28 154214.png

However, the JQL branch option worked! I was able to find this topic and it was really helpful:

https://community.atlassian.com/t5/Automation-questions/Adding-watcher-to-subtasks/qaq-p/1939011

It is suggested to create variables before using JQL, which made the rule run smoothly.

Like Manoj Gangwar likes this
0 votes
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.
October 28, 2024

Hi @Leon Gumba 

I believe there are at least four ways to do this with an automation rule:

  1. With your current rule structure, add the Watchers by calling the REST API endpoint using the Send Web Request action, rather than with Manage Watchers
  2. To create the sub-task, do not branch to the Most Recently Created Issue.  Instead create the issue in the main rule path, setting the Parent field to {{createdIssue.key}} and then branch to Most Recently Created Issue (for the sub-task) to use Manage Watchers
  3. Combining #1 and #2, add the Watchers with the REST API endpoint rather than branching
  4. Using multiple rules, with the second one triggered by the issue create and checking the issue type (and other conditions) to decide when to add the Watchers

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events