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

How can I have a Story automatically update when all of its linked Tasks are DONE?

Rich Evers December 20, 2021

Much like the automation rule where an Epic will automatically update when all of it's Stories are updated to DONE, I want to do the same with Stories and their linked Tasks.

2 answers

0 votes
Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

Hi @Rich Evers 

Welcome to the community.

 

You might wanna get more conditional (I know I would), but the basic version of the automation would be something like:

auto.png

Rich Evers December 20, 2021

Not sure how I would need to get more conditional, but I did exactly the above and it didn't work.  

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.
December 20, 2021

Hi @Rich Evers -- Welcome to the Atlassian Community!

To confirm your use case, which do you mean:

  1. when all of the sub-tasks of a story complete, do <X>
  2. when all of the linked issues (of any type) of a story complete, do <X>
  3. something else?

Case #1 can be done in one automation rule, triggered on the sub-task changing.  There may be an example in the template library like this.

Case #2 probably can be done in one rule, triggered on a schedule (for the story) or from the linked issue, probably using branches, lookup issues, and created variables.  It definitely and safely can be done in two rules, with the original linked issue triggering another rule to get the story to check its linked issues.

Kind regards,
Bill

Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

Good point @Bill Sheboy  

My example is all about linked issues @Rich Evers but either/both can be done.

Other complexities may arise from different workflows and or different "Done" status categories within...resolution codes (if required) etc. But all very doable.

let us know ow you get on.

Rich Evers December 20, 2021

Case #2.  When all of the linked Tasks of a Story are updated to DONE, automatically update Story to Done.  I've tried retrofitting the rule that Jira has pre-defined for the parent-child relationship with Epics and Stories, replacing "parents" and "childs" with "linked" but for whatever reason is not working out.

Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

For Case#2. Can you show us the rule and any info in the audit logs?

Rich Evers December 20, 2021

Screen Shot 2021-12-20 at 3.13.00 PM.png

Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2021

The "For stories (or other issues in Epic)" branch only works if the trigger issue is an Epic.

Try a linked issues branch

Like Bill Sheboy likes this
Rich Evers December 20, 2021

No good.  Thanks, though.

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.
December 20, 2021

Rich, based on your rule and Curt's ideas, does your rule now look like this?  Note I made a substitution in the JQL to check statusCategory instead of status.

Please note: given the possible slowness of this rule, I still think it might cause a run-away, looping condition.  Perhaps the 2-rule approach will cause the hard-stop to prevent this, but it would require some assumptions you have not stated, such as the number and type of linked issues.

Capture.PNG

Like Curt Holley likes this
Rich Evers December 20, 2021

I don't have the options to build it that way.  It will only let me do Types: All link types and that is it.  From there it is only allowing me to chose a condition.  See below: Screen Shot 2021-12-20 at 8.39.22 PM.png

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.
December 21, 2021

Please try changing the Condition to "all match specified JQL" to see that option.

Rich Evers December 24, 2021

If I do that, then I need to manually enter in a field here...Screen Shot 2021-12-24 at 2.45.43 PM.png

Rich Evers December 24, 2021

I've tried putting in various things here and it has errored out.  

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.
December 28, 2021

What have you tried putting in the "matching JQL" field?  What is happening when it errors out?

Please try:

statusCategory = Done
Rich Evers December 29, 2021

I did what suggested above, and it didn't work.  It did not give me an error message, though.  Thanks for the attempt, though!

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.
December 29, 2021

Hi, Rich. 

Just to confirm, would you please post images of your current rule and an audit log details from an attempted execution?  That may reveal something I am not seeing from trying to help, one rule component at a time.  Thanks!

Rich Evers December 29, 2021

Screen Shot 2021-12-29 at 2.46.26 PM.pngScreen Shot 2021-12-29 at 2.56.19 PM.pngI can't seem to figure out what project restriction may be prohibiting the results I'm seeking.

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.
December 29, 2021

Thanks for those images.  Okay...

  • TESTRICH-33 transitioned to Done, and
  • it is linked to TESTRICH-30...so that one was processed in the branch, and
  • TESTRICH-30 did not meet a condition

What is the current status of TESTRICH-30? 

  1. If it is not Done, the first condition was not matched
  2. If it is Done, it is the second condition which needs investigation.
Rich Evers December 29, 2021

30 did not update to done.  The link "how" I guess, are all labeled as "relates to."  I guess another question, is that why can't we have a parent-child relationship with stories and epics, like we do epics and stories?  That is ultimately what I'm trying to do.  Am I going about this the correct way?

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.
December 29, 2021

For epics and stories/tasks/bugs, the relationships are easier:

  • when going from epic to children, use the built-in branch option
  • when going from children to epic, use a JQL branch with "epic link" = {{triggerIssue.epic link}}

My understanding was you were evaluating any links, and not just epic/children.  Was I incorrect?

Rich Evers December 29, 2021

Correct, I think.  All I want to see happen is that when all the tasks are updated to DONE that are assigned to a specific story, the said story will update to DONE as well.

The hard part is that I'm not a tech-y software guy, so all of this language and how the software works is very foreign.  I just want to it work and do things that I want it to do.  :)

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.
December 29, 2021

Let's confirm how you use issues In Jira as that will confirm we are talking about the same thing.  In Jira, you can relate issues with a hierarchy and/or linked issues:

Hierarchy of issues

  • Epics
    • Stories
      • Subtasks

Linked issues

  • Any issue (Epic, Story, Task, Subtask, Bug), linked to another issue

 

Which of these matches what you are doing: hierarchy or linked?

Rich Evers January 3, 2022
  • epics
    • stories
      • tasks

Trying to link tasks to stories because there is no ability to create a parent-child relationship between the two.  Epics and stories have the parent-child relationship already pre-built in the software.

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.
January 3, 2022

Thanks! 

Next, can any single Task be linked to multiple Stories? (Note there is no restriction to this in Jira so this would just be manually enforced.)

If so, what you describe cannot be done with automation rules.  The act of checking from Task --> Story --> Task --> Story... could create a loop.

Rich Evers January 3, 2022

Negative.  A task belongs to a single dedicated story.

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.
January 3, 2022

Okay, then let's try this one for Task to Story to Tasks, using lookup issues to check the counts, step by step

  • trigger: issue transitioned to Done
  • condition: issue type is Task
  • action: lookup issues to get the one-and-only-one Story (if any exist)
    • JQL: issue IN linkedIssues( {{triggerIssue.key}} )
  • advanced compare condition: {{lookupIssues.size|0}} equals 1
  • advanced compare condition: {{lookupIssues.first.issueType}} equals Story
  • action: create variable for varStoryKey set to {{lookupIssues.first.key}}
  • action: lookup issues to get any issues linked to the story which are not done
    • JQL: issue IN linkedIssues( {{varStoryKey}} ) AND statusCategory != Done
  • advanced compare condition: {{lookupIssues.size|0}} equals 0
  • branch: on JQL to the story with key = {{varStoryKey}}
    • action: transition the story issue, copying from trigger issue (Done)
Neelam Manhas August 10, 2022

I am looking to create the same automation as requested originally, wondering if this worked? and what i need to do the following below.

looking for the following:

when all Tasks in Project 1 are set to status DONE, i want the user story that they are linked to in with Project 2  to be set to Ready to Test and I want the assignee updated at the same time.  (hierarchy being used is User story ==> multiple tasks to complete the user story)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events