Forums

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

Compare Epic's due date with all child due dates

Maurice B_
Contributor
February 5, 2025

Dear community, 

I need your support. 

I'd like to create following rule: 

  1. Every Thursday 
  2. Lookup issues with some filter criteria
  3. and check if the due date of child tickets is greater than the due date of the parent epic. 
  4. Then send ONE email with all epics that have child issues which exceed the epic's due date. 

I tried the condition the following condition but It did not work. 

{{lookupIssues.parent.dueDate}} is lower than {{lookupIssues.dueDate}}

Any clue how to solve that? Thanks! 

 

1 answer

1 accepted

1 vote
Answer accepted
Vishal Biyani
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.
February 5, 2025

@Maurice B_ 

I wrote this sample rule. See if this gets you going. Assumption is if any of the child issue has a due date > than parent, then it needs to be flagged.

Therefore, I used max to simplify the logic.

 

snip.png

Maurice B_
Contributor
February 5, 2025

Hi @Vishal Biyani,

thank you, that check works. But with that rule, all lookup issues are displayed in the audit log. Do you know how to add only those issues that correspond to the condition? 

Thank you! 

Vishal Biyani
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.
February 5, 2025

adding this condition

{{#lookupIssues}} {{ if( due date.isAfter(parent.due Date) ) }} {{key}} {{parent.key}} {{/}}

 

gives True if issues due date is after parent due Date otherwise it does not print anything.

 

This logic you can build in email template to send issues that match the condition

Vishal Biyani
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.
February 5, 2025

@Maurice B_ 

There was slight error in the above. use this and you will get the required issue keys.

{{#lookupIssues}} {{ if (due date.isAfter(parent.due Date), key) }} {{/}}

 

If this helps you, please accept the answer so that others can also benefit

Maurice B_
Contributor
February 6, 2025

thank you, Vishal!
 
If the condition matches, the output works fine. But for those issues the condition does not match, empty rows are displayed in my email output, screenshot below: 

image.png
Is there something like an "else function", so if the condition does not match, do not create a row in the table? 

and secondly, I'd like to have a scheduled trigger and not a manual trigger. If I just replace it, the branch reports an error like no issues found. 

Do you know how to fix that? Thanks!

Maurice B_
Contributor
February 13, 2025

@Vishal Biyani : Do you have any proposals on my question above? Thank you!

Vishal Biyani
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.
February 13, 2025

@Maurice B_ 

Can you share your rule so far?

Also, share the logic that you are using when creating the table.

Maurice B_
Contributor
February 14, 2025

Hey @Vishal Biyani

 

this is the rule that I have created so far

Bildschirmfoto 2025-02-15 um 00.18.01.png

And the html body of the mail I'm currently using is: 

 

<html>
<body>
<table border="1" cellpadding="5">
<tr>
<th>Ticket</th>
<th>Beschreibung</th>
<th>Komponente</th>
<th>Bearbeiter</th>
<th>Fälligkeit Epic</th>
<th>spätestes Fälligkeitsdatum untergeordnete Tickets</th>
<th>Link zum Epic</th>
</tr>
{{#lookupIssues}}
<tr>
<td>{{parent.key}}</td>
<td>{{parent.Summary}}</td>
<td>{{parent.components.name}}</td>
<td>{{parent.assignee.displayName}}</td>
<td>{{parent.dueDate}}</td>
<td>{{dueDate}}</td>
<td>{{parent.url}}</td>
</tr>
{{/}}
</table>
</body
</html>
Vishal Biyani
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.
February 14, 2025

@Maurice B_ 

It is possible that double lookups are causing this issue. The logic can be simplified as below:

  • Trigger = Scheduled
  • Lookup use JQL:

    project = <your project> and issuetype in standardIssueTypes() and issuetype != Epic and parent IS NOT EMPTY and component in (<your list of components)
    This will return all standard issues that have a parent Epic

  • Then in Send Email component, filter out rows and include only those rows that have due date past the epics due date. I have used your format and added 1 more column (child issue key) + condition to filter out rows. The reason to include child issue key is for the end user to easily identify which issue in the epic is past due date.

See if this works for you.

<html>
<body>
<table border="1" cellpadding="5">
<tr>
<th>Issue Key</th>
<th>spätestes Fälligkeitsdatum untergeordnete Tickets</th>
<th>Epic</th>
<th>Beschreibung</th>
<th>Komponente</th>
<th>Bearbeiter</th>
<th>Fälligkeit Epic</th>
<th>Link zum Epic</th>
</tr>
{{#lookupIssues}}
{{#if (due date.isAfter(parent.due Date))}}
<tr>
<td>{{key}} </td>
<td>{{dueDate}}</td>
<td>{{parent.key}}</td>
<td>{{parent.Summary}}</td>
<td>{{parent.components.name}}</td>
<td>{{parent.assignee.displayName}}</td>
<td>{{parent.dueDate}}</td>
<td>{{parent.url}}</td>
</tr>
{{/}}
{{/}}
</table>
</body
</html>

 

snip.png

Maurice B_
Contributor
February 17, 2025

Hi @Vishal Biyani , 

thank you for your adjustments. 

But unfortunately, the rule does not work properly. The automation itself works but there are no tickets expressed in the email output even if there are a few tickets that meet the condition. 

Could you please check once again? Thank you!

Vishal Biyani
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.
February 17, 2025

To debug the issue can you share the audit log and expand each step.

Also, share the screen shot of the updated automation that you have.

The lookup issue should show issues if the JQL matches. Logs will hopefully help debug where the issue is happening

Maurice B_
Contributor
February 17, 2025

Dear @Vishal Biyani , 

the new rule looks like this: 

Bildschirmfoto 2025-02-17 um 09.54.35.png

As I said, the rule execution itself was successful. 

Bildschirmfoto 2025-02-17 um 09.55.06.png

An email has been sent but it contains only the headers and no content: 

Bildschirmfoto 2025-02-17 um 09.59.33.png

The new html body: 

<html>
<body>
<table border="1" cellpadding="5">
<tr>
<th>Epic</th>
<th>Fälligkeit Epic</th>
<th>Ticket</th>
<th>Beschreibung</th>
<th>Komponente</th>
<th>Bearbeiter</th>
<th>Fälligkeit Epic</th>
<th>Link zum Epic</th>
</tr>
{{#lookupIssues}}
{{#if(dueDate.isAfter(parent.dueDate))}}
<tr>
<td>{{key}} </td>
<td>{{dueDate}}</td>
<td>{{parent.key}}</td>
<td>{{parent.Summary}}</td>
<td>{{parent.components.name}}</td>
<td>{{parent.assignee.displayName}}</td>
<td>{{parent.dueDate}}</td>
<td>{{parent.url}}</td>
</tr>
{{/}}
{{/}}
</table>
</body
</html>

 

Vishal Biyani
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.
February 17, 2025

When you run the JQL which is being used in lookup in JIRA search window, how many rows do you get?

Also, the assumption is both Epic and its child issues have due date populated. if that is not the case, then comparison won't work and could result in a blank email.

Can you check on these two points?

 

Maurice B_
Contributor
February 17, 2025

@Vishal Biyani

the JQL statement finds 614 issues in the lookup action. There are some child issues that do not contain a due date. 

Edit: I have added the part "AND dueDate is not EMPTY" to the JQL statement and now it works and the email output is not blank anymore! 

Thank you so much!

 

Vishal Biyani
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.
February 17, 2025

WOW!!! Good to know that it worked for you. in the process, I also learnt few things :-).

Suggest an answer

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

Atlassian Community Events