How to automate story ticket status when all linked task move to `Ready for Staging` or `Done`?

dian_marsha October 18, 2024

Hi, I'm trying to automate story status update when all linked task has moved the status to `Ready for Test` or `Done`. But it seems like, story status just moved when I update one of linked task status??

Is there any step left from my rules?

Any help would be appreciate. Thanks.

 

image.png

1 answer

1 accepted

1 vote
Answer accepted
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 18, 2024

Hi @dian_marsha -- Welcome to the Atlassian Community!

For automation questions, it helps to include an image of the audit log details showing the rule execution.  That will confirm which / how the steps processed.

 

Would you please confirm if this is your scenario:

GIVEN a Story exists with one or more linked Tasks with link type "Blocks"
AND the Story is not in the "Ready for Test" status
AND all of the Tasks have a Platform value with any of Android, Backend, IOS, or Web
AND all but one linked Tasks are in a status of "Ready for Test" or "Done"
WHEN the last linked Task transitions to "Ready for Test" or "Done"
THEN transition the Story to "Ready to Test"

Can there be other linked issues to the Story which will not impact the status change?  For example, a Task with a different Platform, link type, or status value?

Can there be more than one Story linked to the Tasks in the way you describe?  If so, which one should be transitioned?

When all of the linked Tasks are "Done", should the Story still transition to "Ready to Test"?

 

Looking at the rule image you show, you have a Related Issues Condition on link type and JQL for the Story only.  There is no check of all of the other, linked Tasks.

There are a couple of ways to solve this scenario:

  • Get the key for the linked Story, and then use JQL with a Related Issues Condition to check just the Tasks which are linked to it, by inverting the status check.  Then set the condition to none are found.  (This could also be done with the Lookup Issues action and checking the counts.)
  • Branch directly to the linked Story only, with JQL, and then perform one single Related Issues Condition on the linked Tasks

 

Kind regards,
Bill

dian_marsha October 19, 2024

Hi @Bill Sheboy 

Thanks for your answer..

Would you please confirm if this is your scenario:

GIVEN a Story exists with one or more linked Tasks with link type "Blocks"
AND the Story is not in the "Ready for Test" status
AND all of the Tasks have a Platform value with any of Android, Backend, IOS, or Web
AND all but one linked Tasks are in a status of "Ready for Test" or "Done"
WHEN the last linked Task transitions to "Ready for Test" or "Done"
THEN transition the Story to "Ready to Test"

--> Yes, that's true.. Story status should be updated to `Ready to Test` after all linked task has moved to `Ready to Test` or `Done`

 

Can there be other linked issues to the Story which will not impact the status change?  For example, a Task with a different Platform, link type, or status value?

--> Yes, it can.. but just ignore others linked issue which not mentioned as I shared above

 

Can there be more than one Story linked to the Tasks in the way you describe?  If so, which one should be transitioned?

--> Nope, there should only one story linked to the task. But if it turns out to has more than 1 story linked. So all story linked should also move the status to `Ready for Test`

 

When all of the linked Tasks are "Done", should the Story still transition to "Ready to Test"?

--> It depends on previous task status before move to done. There are 2 cases :

1. If all task move directly to `Done` from `Ready for Test` then story should move to `Ready for Test`

2. But when all task move to `Done` from `Ready for Production` then story should move to `Done` also

 

Looking at the rule image you show, you have a Related Issues Condition on link type and JQL for the Story only.  There is no check of all of the other, linked Tasks.

There are a couple of ways to solve this scenario:

  • Get the key for the linked Story, and then use JQL with a Related Issues Condition to check just the Tasks which are linked to it, by inverting the status check.  Then set the condition to none are found.  (This could also be done with the Lookup Issues action and checking the counts.)

--> Can you elaborate more or give an example for JQL query. I've tried JQL to `Lookup Issues` but it failed. I'm newbie for JQL query.

  • Branch directly to the linked Story only, with JQL, and then perform one single Related Issues Condition on the linked Tasks

--> Herewith I attached image refer to what you mentioned, is it correct?

image.png

 

Again, thanks for your help

Like Steffen Opel _Utoolity_ likes this
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 19, 2024

As a suggestion when responding in the community, there is no need to copy everything from a prior post with your answers.  Answering should be enough for the context to be clear.  Thanks!

 

Next thing: you describe different behaviors depending upon if all of the linked Tasks transitioned from different statuses (Ready for Test versus Ready for Production).  That is not easily detectable in a rule as only one Task's update triggers the rule.  I recommend building a basic case first, and then decide if you need additional levels of rule control.

 

Let's pick one scenario to see what I was suggesting: 

  • trigger: issue transitioned to "Ready to Test" or "Done"
  • condition: issue type equals Task
  • condition: Platform contains any of Android, Backend, IOS, or Web
  • branch on JQL: to get the Story, using the linkedIssues() function
    • issue IN linkedIssues("{{triggerIssue.key}}", "blocks", "is blocked by") AND issueType=Story AND status NOT IN ("Ready for Test", "Done")
      • action: lookup issues with JQL, to find the Tasks linked to the Story
        • issue IN linkedIssues("{{issue.key}}", "blocks", "is blocked by") AND issueType=Task AND status NOT IN ("Ready for Test", "Done") AND Platform IN ("Android", "Backend", "IOS", "Web")
      • smart value condition:
        • first value: {{lookupIssues.size}}
        • condition: equals
        • second value: 0
      • action: transition issue to "Ready to Test"

 

I recommend pausing to test the JQL for the branch and lookup using example issues, outside of the rule with Filters > View All Issues. 

Once it works as expected you may then use the JQL needed for your rule.  Then test the rule fully for the different cases.  Finally, consider enhancing the rule or create additional rules for the other paths.

dian_marsha October 21, 2024

Hi @Bill Sheboy , really appreciate for your detailed, clear response and explanation on my question. It works, now!! I'll try to explore for additional levels rule of control as your suggestion.

Thanks again for your help. Have a great day!

Like # people like this
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 21, 2024

Awesome; I am glad to learn that helped!  Please consider marking this question as "answered" to help others with a similar need find solutions faster.  Thanks!

Like dian_marsha likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events