Automation: Detect the earliest date in child issues and copy it to the Epic

Amy Chang May 6, 2024

Hi Community,

 

If I add an issue to an Epic, how can I detect which child issue starts first and copy its Start Date to the Epic's Start Date?

 

Thank you!

2 answers

0 votes
Amy Chang May 14, 2024

-

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.
May 6, 2024

Hi @Amy Chang 

What have you done thus are to solve this need?

 

If you have an automation rule and it is not working as expected, please post an image of your complete rule, the audit log details, and describe what is not working.  Those will provide context for the community to offer suggestions.

 

If you have not started a rule, I recommend trying to do so.  This will help you learn more about rules and be better able to confirm the problem solved meets your needs.  Your rule could use the Lookup Issues action, with JQL, to gather the child issues of the epic, and then identify the earliest date with the min function, such as with:

{{lookupIssues.Start date.min}}

Before building the rule(s), I recommend confirming your understanding of what to do in several cases as additional rules may be needed.  What happens when...

  1. an issue is added to an Epic (your original question)
  2. an issue is removed from an Epic
  3. an issue is moved from one Epic to another (a special case combining #1 and #2, above)
  4. a child issue of an Epic is deleted
  5. a child issue's type is changed
  6. a Start Date is changed in a child issue of the Epic
  7. someone manually changes the Start Date in the Epic
  8. one (or more) of the child issues of the Epic are stored in a different Jira project than the Epic
  9. etc.

Kind regards,
Bill

Amy Chang May 14, 2024

Hi @Bill Sheboy 

Thank you for your reply.

I did this by comparing the start date of the trigger issue and the Epic. If the trigger issue's start date is less than the Epic's start date or the Epic's start date field is empty, it will copy the trigger issue value to the Epic.

Screenshot 2024-05-14 at 4.25.50 PM.png

However, I think the lookup issue action will be more precise. If I use the current method, even the system copies the value from the child issue, but we cannot guarantee that the date is the earliest date from the child issue.

 

I tried to use Smart Value Comparision to compare the original Epic ({{#changelog. epic link}}{{from}}{{/}}) and the new Epic ({{#changelog. epic link}}{{to}}{{/}}), and lookup the value from the new Epic if a child issue added in it. However, it doesn't work, and it seems the lookup action didn't support the Start date field. So I'm still figuring out how to read the child issues' Start Date when an issue is removed from an Epic.

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.
May 15, 2024

Are you using Jira Cloud, Server, or Data Center version?  If using Jira Cloud, the Lookup Issues action supports all current issue fields, including Start date.

And...the Epic Link field is sunsetting for linking Epics to their child issues in Jira Cloud.  Instead please use the parent field.

 

For the change of epic parent scenario, you could call Lookup Issues twice to update the two impacted epics...

To find the child issues of the current parent:

parent = {{triggerIssue.parent.key}}

To find the child issues of the previous parent, first confirm there was an old parent, and then use this JQL:

parent = {{#changelog.parent}}{{fromString}}{{/}}

 

 

Suggest an answer

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

Atlassian Community Events