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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,415
Community Members
 
Community Events
184
Community Groups

JQL for Automation to move tickets based on sub-task's statuses

Hi. For our pipeline, we need to know how to set automation for a custom issue type, so that the automation;

1) Check the statuses of all the sub-tasks belonging to the parent issue.

2) Transition the parent issue to the same status as the sub-task that has the status FURTHEST TO THE LEFT (earliest) in the Workflow (or upwards in the workflow map).

As we need to have the parent issue in a status that reflects how far the least worked-on sub-task has come in the pipeline.

Does anyone know how to do this?

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 27, 2023

Hello @Daniel Ronnstam 

What have you got so far for your automation for this?

Here is the start of a rule for one way you could accomplish this. I'm sure there are other ways, and I may think of a more elegant one later.

Screen Shot 2023-03-27 at 11.35.22 AM.png

 

The inelegant part of this is that you have to set of multiple IF/Conditions within the branch based on the available statuses, because you can't embed an IF/ELSE structure under a branch.. The first one checks if there are any sub-tasks in the left-most status of your workflow. If so, then set the parent status accordingly.

For the next set of conditions you have to check if there are any sub-tasks in the next status in the workflow AND confirm there are no sub-task in earlier statuses. You have to do this because without the ELSE structure the second set of conditions will be check even if the first set of conditions was matched.

Say you have a parent issue that has Sub-tasks that are in To Do and some Sub-tasks that are in In Progress. The first IF would find there are Sub-tasks in To Do and set the parent to To Do. The second set of conditions would initially find Sub-tasks in In Progress. If you didn't also check that there were no Sub-tasks in To Do, then the parent would be transitioned again to In Progress because some Sub-tasks are In Progress.

 

Brainstorming...

Another way to do this that would allow you to have an If/Else block would be to have one rule that is triggered by the Sub-task transitioning. In that rule only set a flag on the parent to note that a sub-task was transitioned.

Screen Shot 2023-03-27 at 11.44.36 AM.png

Then have a second rule that looks for a change in that Flag for the parent issue. Remove the flag, then use If/Else blocks to check for the statuses of Sub-tasks and set the parent issue status accordingly.

You would have to make sure that this rule had in the Details the box checked to "allow other rule actions to trigger this rule"

Screen Shot 2023-03-27 at 11.50.00 AM.png

I tried the first solution, and "almost" got it to work. The first rule works but not the second. I'm only trying with 3 statuses for now although I would need about 6 in the finished version. Is there something wrong with the "OR" logic? Will that not work?

automation.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 28, 2023

What is the order of your statuses?

This step

Screen Shot 2023-03-28 at 1.50.51 PM.png

should include only the statuses that are earlier in the workflow than this step

Screen Shot 2023-03-28 at 1.51.43 PM.png

TO DO
WAITING
IN PROGRESS


Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 29, 2023

In that case you second IF statement should be looking for 

Some Sub-tasks match 

status = "WAITING"

AND No Sub-tasks match

status = "TO DO"

 

Then you would have a third IF statement like

Some Sub-tasks match

status = "IN PROGRESS"

AND No Sub-tasks match

status in ("TO DO", "WAITING")

Ok gotcha. I will try this. Actually, I have the following statuses in total. I noticed that it takes about 1 min before the parent ticket auto-moves. I guess that is because all the IF statements?

TO DO
WAITING
IN PROGRESS
UI REVIEW
CODE REVIEW
QA
TEST
UAT
DONE

Hi. I tried to set it for the 3 first statuses. I got the following:

bugs.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 30, 2023

When saying a rule doesn't work, it is helpful if you provide the Audit Log details for the rule.

I went ahead and constructed the rule in my own environment to see how it would work. And I found it did not work. When there were no subtasks in the To Do status, the rule stopped executing at that first IF block.

I found that I had to separate the IF blocks into their own Branches, thus.

Screen Shot 2023-03-30 at 10.42.33 AM.png

Thanks!! I will try this out now!!

I almost got it working. It works for some steps in the full pipeline, but got the following log error. Are there some errors in the syntax?

 

ACTION DETAILS:

["10002"]

ISSUE CONDITION

The following issues passed:

VP-15

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues passed:

VP-5

RELATED ISSUES CONDITION

JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:

"((parent = VP-5) AND (status = ("TO DO", "WAITING", "IN PROGRESS"))) AND (project in (10002))" - Operator '=' does not support the list value '("TO DO", "WAITING", "IN PROGRESS")' for field 'status'.

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues passed:

VP-5

RELATED ISSUES CONDITION

JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:

"((parent = VP-5) AND (status = ("TO DO", "WAITING", "IN PROGRESS", "UI REVIEW"))) AND (project in (10002))" - Operator '=' does not support the list value '("TO DO", "WAITING", "IN PROGRESS", "UI REVIEW")' for field 'status'.

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues passed:

VP-5

RELATED ISSUES CONDITION

JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:

"((parent = VP-5) AND (status = ("TO DO", "WAITING", "IN PROGRESS", "UI REVIEW", "CODE REVIEW"))) AND (project in (10002))" - Operator '=' does not support the list value '("TO DO", "WAITING", "IN PROGRESS", "UI REVIEW", "CODE REVIEW")' for field 'status'.

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

RELATED ISSUES CONDITION

The following issues did not match the condition:

VP-5

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 31, 2023 • edited Apr 04, 2023

The error message tells you what the problem is.

JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:

"((parent = VP-5) AND (status = ("TO DO", "WAITING", "IN PROGRESS"))) AND (project in (10002))" - Operator '=' does not support the list value '("TO DO", "WAITING", "IN PROGRESS")' for field 'status'.

You need to change the JQL to

status in (<comma separated list of values>)

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

If you have been able to successfully complete the automation rule and it is working as you desire, please consider marking the Answer as Accepted to help other users find posts with validated solutions.

Like Daniel Ronnstam likes this

Thanks it works!!!

Like Trudy Claspill likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 05, 2023

Great! Glad I could help.

If your question has been answered please consider marking this Answer as Accepted to help other users find posts with validated solutions.

Thanks!!! I will try out some of these ideas today or tomorrow and get back to you.

Suggest an answer

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

Atlassian Community Events