Forums

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

How do I automatically link a new issue to an epic if the month and year of due date match?

J F July 28, 2023

I'm trying to create an automation rule in Jira where upon new issue creation (which has a BAU label and due date automatically populated), it checks for an Epic with a BAU tag and a due date which matches the month & year of the new issue's due date.

Example workflow:

  • Already in system: BAU Epic (label: BAU, due date: 31 July 2023)
  • New issue created: Task 1 (label: BAU, due date: 21 July 2023).
  • Automation Rule triggers upon creation: Checks for Epic label = BAU AND Epic due date month and year = Task 1 due date month and year.
    • If both conditions are TRUE, add Epic link for BAU Epic to Task 1.

Appreciate any guidance on whether this is possible and if so, how to proceed. Thank you

1 answer

1 accepted

4 votes
Answer accepted
Mark Segall
Community Champion
July 28, 2023

Hi @J F and welcome to the community!

You could do something like this:

  • TRIGGER: Issue Created
  • CONDITION: Labels Contains BAU
  • ACTION: Create Variable
    • varMonth
    • {{issue.dueDate.format("MM")}}
  • ACTION: Create Variable
    • varYear
    • {{issue.dueDate.format("yyyy")}}
  • ACTION: Lookup Issues
    • issueType = Epic and labels IN (BAU) AND dueDate >= "{{varYear}}-{{varMonth}}-01" AND dueDate < "{{varYear}}-{{varMonth.asNumber.plus(1)}}-01"
  • CONDITION (Advanced)
    • {{lookupIssues.size}}
    • Equals
    • 1
  • ACTION: Edit Issue (Epic Link)
    • {{lookupIssues}}
J F July 28, 2023

Thanks for your help @Mark Segall

I'll give this a go and let you know if it works out.

Like Mark Segall likes this
J F July 30, 2023

Everything works (lookup issues matches with the correct Epic) except for the last condition {{lookupIssues.size}} Equals 1. Any ideas why this might be the case?

Edit: fixed the issue through a refresh. Thanks again @Mark Segall !

Like Mark Segall likes this

Suggest an answer

Log in or Sign up to answer