Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Automation whenever subtasks and linked tasks are changed

I am using an automation to calculate the number of subtasks and linked tasks on a story that is then displaying as the story points (we're not at a stage where we want to really determine the story points ourselves). The formula I have is {{issue.subtasks.size}} + {{issue.issuelinks.inwardIssue.size}} + {{issue.issuelinks.outwardIssue.size}}. I have it setup so that it runs extremely well when subtasks are created and when linked tasks are added, but I was wondering if there was a way to simplify it so that it would run the automation whenever subtasks and linked tasks are added, moved, deleted, etc. so that we don't have to have separate automations for each one. Anyone know if this is possible?

1 answer

Hi @Anne Dietz -- Welcome to the Atlassian Community!

I wonder if you could change to just use the issue updated trigger and update your count unconditionally.  This would cause a few unnecessary updates due to changes from unrelated fields (e.g. description comments, etc.).  You might mitigate that by using the changelog and conditions (based on issue type) to see if subtasks or links were impacted, and only proceed if they were.

Kind regards,
Bill

Hi @Bill Sheboy!

Thanks so much! It looks like that would work for subtasks on the story but not for linked issues. I think I would just need a separate one for deleted or removed linked issues. I have one setup for removed linked issues, but I don't know yet if the linked issue is deleted instead of removed if that will trigger it.

We are not using delete, so you would need to try that to see if the change to the links triggers the rule. 

We disabled delete and instead use a custom field, Abandoned.  There is no "undo" with Jira Cloud, so it saves a lot of "oops" situations.

Thanks, Bill! That is very helpful to hear how others are doing it. I'm not too excited about the team having use of the delete function, but we've been relatively small until now so it hasn't caused really any issues yet, but I'm sure we'll reach that point when it does.

Thanks, Anne.  Just to follow-up, when you try the delete issue, does it detect that as changing the links in the trigger for any linked issues?

That's a great point for testing. Right now when I'm testing, I'm not deleting anything that has linked issues underneath, but it is possible that they might down the road. I'm testing the delete on the Story subtasks, but I've also grouped it with Issue Moved and Issue Updated. It looks like this:

Screenshot 2021-12-01 104204.png

The issue with this is that it is seeing the new parent and not the old parent for moved issues. Ideally, I'd like it to see both. I've tried For Linked Issues instead of Parent and For Destination Issue, but my triggers aren't right for it. I was contemplating if I could run it up to the epic level and have it flow down, but I need the epic to be the sum of all the tasks in all the stories underneath it, so I don't think that would work out either.

Regarding move, I recall seeing some open issues on moves correctly providing the "from" for automation.

How about this: split the problem so you have one rule which roles up subtasks to the story, and a second one for stories to epics?  Having two rules reduces the complexity, simplifies the testing, and will generally be more maintainable.

One key to making this work is when a change to a story could trigger the epic rule, look in the rule details to enable the option "Allow rule trigger".  This is disabled by default to prevent accidental looping conditions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

556 views 20 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you