Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to find epics then edit priority of child tickets based on IF statement

Aaron Hunt October 16, 2024

I am trying to build what feels like a simple automation but hitting a mental brick wall :)

Steps in my automation needed:

1) Run JQL to gather list of epics (the Then: Lookup issues part.  This works in a standard filter and returns the epics I need)

2) For every child issue of those epics that meets a specific criteria then edit the child issue.

I've tried using For: Children, but think I'm missing some step to pass information to the branch.  

Any help would be appreciated!

Screenshot 2024-10-16 092159.png

 

2 answers

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 16, 2024

Hi @Aaron Hunt 

For the scenario you describe, you seem to want this:

GIVEN a specific set of Epics
WHEN a scheduled time has arrived each day
THEN for each child of an Epic which has a specific status and type, add a Label to the child

Branches cannot be nested in rules (yet), and as written your rule cannot access the child issues for edit.

 

The solution is to get the Epics from the Scheduled trigger using JQL, and then branch to any child issues using JQL to reduce the complexity of your rule.  For example:

  • trigger: Scheduled, with JQL to return just the Epics you need to check
project = CAM
AND issuetype = Epic
AND "uat due date[date]" >= 2d
AND "uat due date[date]" <= 3d
ORDER BY Key ASC
  • branch: on JQL to gather and filter the child issues
project = CAM
AND parent = {{issue.key}}
AND issuetype IN (Story, Task)
AND status NOT IN ("Done", "Cancelled (Cancelled)"
ORDER BY Key ASC
  • action: edit the label of the child issue

 

Kind regards,
Bill

Aaron Hunt October 18, 2024


Thanks Bill

I think I'm still doing something wrong as this isn't itterating.  Perhaps I have the wrong branch?  I tried with a for each then another lookup but that didn't work either (same issue of it not itterating)
In the first lookup issues it finds two epics, but then when the branch happens it's only applying to one of the two.

Screenshot 2024-10-18 151943.png

The ones it misses are definately "in scope" insomuch as if I put the query into a filter, it finds all the relevant child issues. i.e. the filter is 

Screenshot 2024-10-18 155559.png

Any ideas?

0 votes
Marc - Devoteam
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 16, 2024

Hi @Aaron Hunt 

To use the information from the lookup, you need to use an advanced branching option.

This will take the information from the lookup action you have done, so this will be all the epic issues found.

So first of all you would need to find all children of a certain set of Epics.

You could use the JQL options: 

issue in (<comma separated list of Epic issue keys) or parent in (<comma separated list of Epic issue keys)

Or

With 3rd party apps that extend the JQL capabilities it is possible to get the child issues of Epics based on a filter that gets the Epics.

Do you have such an app or are you willing to purchase one?

Aaron Hunt October 16, 2024

Thanks for the reply Marc.  The problem is I can't use a comma separated list of epic issue keys as I don't know what the keys will be.  The first JQL will just give me a list based on specific parameters and therefore the list will change regularly.

As at the moment this is a one off request I'd not be willing to purchase any third party apps.

Marc - Devoteam
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 16, 2024

Hi @Aaron Hunt 

There is no option when using lookupisues and branch with children option.

Using lookupissues you can only do an advanced branch, based on using the smart variable {{llookupissues}} and give that variable a name.

This will iterate on the found issues in the lookup.

You could try to add another lookup in the branch.

I didn't test it, but here is the example I built.

Screenshot 2024-10-16 at 12.27.18.png

Aaron Hunt October 16, 2024

That's partially working, in that it's picking up one of the child tickets and updating it, but it doesn't appear to be iterating.  Can you share what you entered into the For each part?  I have this, but I'm unsure if I need to go deeper than the lookupissues part?

Screenshot 2024-10-16 124416.png

Marc - Devoteam
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 16, 2024

Hi @Aaron Hunt 

They way you want this will not work as it would require a 3rd level branch, that is not an option.

We could look at searching differently.

Find the issues of a certain type(s) in a certain status(es) in a certain project(s) and parent field is not empty.

Place that in a lookup and then branch based on JQL

I tried it and it worked on my side.

Screenshot 2024-10-16 at 14.40.15.png

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