JIRA automation: Update Epic Link when a JIRA issue is created

Caleb Park April 17, 2024

Hi guys,

I am trying to build an automation that updates Epic Link to a specific existing Epic depending on the Epic Due Date when a JIRA issue is created.

 

For example, there are already 12 existing monthly Epics:

1. January Epic with Epic Due Date on 01/31/2024

2. February Epic with Epic Due Date on 02/28/2024

3. March Epic with Epic Due Date on 03/31/2024

So on...

 

Now when a Story with Story Due Date is created, it should be linked to the applicable Epic according to the Epic Due Date.

For instance:

When a Story with Story Due Date 01/31/2024 is created, then it should be linked to the January Epic.

When a Story with Story Due Date 02/20/2024 is created, then it should be linked to the February Epic.

When a Story with Story Due Date on 03/10/2024 is created, then it should be linked to the March Epic.

 

 

This is what I have in the automation so far:

1.png

 

But I noticed this method does not work.

 

So I decided to use the following method, but I have no idea how to use JQL to Edit issue function.

2.PNG

 

Is it feasible to add JQL to specify a specific Epic in Edit Issue element?

Or is there any alternative way to make it work?

 

Thank you so much for your help!

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.
April 17, 2024

Hi Caleb,

You appear to be using Jira Data Center, correct?

If so, please try the Lookup Issues action with JQL to find the needed epic, and then use the result when setting the epic link to:

{{lookupIssues.first.key}}

You can build the JQL to find your needed epic with the date / time functions: https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html

Here is a reference for the lookup issues action: https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html#Jiraautomationactions-lookup-issuesLookupissues

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer