Forums

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

A loop within a loop in email

Бабій Олександр November 28, 2023

Good day!
Tell me how to build it
{{#lookupIssues}}
<a href="{{url}}">{{key}} - {{summary}}</a>
{{/}}

Convert to
{{#Epic}}
Epic name
{{#lookupIssues}}
<a href="{{url}}">{{key}} - {{summary}}</a>
{{/}}
{{/Epic}}

1 answer

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.
November 28, 2023

Hi @Бабій Олександр 

Context is important for automation rules.  For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide the context for the community to offer ideas.  Thanks!

Until we see those...

The Lookup Issues action gathers issues using JQL for later processing, including loop iteration.  But there is not generic {{Epic}} smart value to allow looping over epics.

It appears you are trying to create an email body listing issues, grouped by their epics.  Is that correct?

If so, that can only be done if there is known, fixed list of epics.  That would allow iterating over each epic's issues, one at a time.

An alternative is to use JQL for your lookup issues, ordered by the Epic Link.  And then create a table with HTML, listing the epic link as the first column.

Kind regards,
Bill

Бабій Олександр November 30, 2023

Thank you!
I am still looking for a solution.
If there is no way to use the cycle in the cycle (although the support wrote "try it, maybe it will work") - I will look for other options.

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.
November 30, 2023

Iterators inside of iterators are possible, but not for the scenario you show in your question.  The support team is incorrect in this case.

 

Again, if you want feedback and suggestions on your scenario, please post an image of your complete rule (in a single image), images of the actions / branches / conditions, and an image of the audit log details showing the rule execution.

Бабій Олександр November 30, 2023

In this case, there are no branches and complex conditions.
There is a script in the documentation that displays a list of tasks.
It is necessary for the script to output the Epic and the tasks that belong to it, then the following epic and the tasks that belong to it, and so on for all the epics and tasks.d5693-clip-55kb[1].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.
November 30, 2023

As noted repeatedly, that is not possible with rule iterators.  The rule could get close to that format using an HTML table.  It could get closer still by adding a custom field to assist in sorting the epics and their child issues together.

And please note: lookup issues is limited to 100 issues.  If your expect your JQL to return more than that, seek another solution, such as a marketplace addon for reporting.

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