Forums

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

Automation to find an epic based on story's fields and then set the epic link on the story

Jenn Sherman
Contributor
April 14, 2022

I'm trying to figure out an automation to set the epic link on a story by searching for an epic that matches certain fields on the story.  

Here is what I have so far:

Capture1.PNG

For each story I want to find an epic that has the same value in field A as the story has in field A, then

Set that epic as the Epic Link on the story

1 answer

0 votes
Mark Segall
Community Champion
April 14, 2022

Hi @Jenn Sherman - Here's how I would tackle this one:

  1. Add a Lookup Issues Action with the following JQL to find the corresponding epic (assuming you're using Airtable Link as the means of identifying the appropriate epic and that there's only one match that will be found):
    1. "Airtable Link[URL Field]" = {{issue.Airtable Link}} and issueType = Epic
  2. Add an Edit Issue action
    1. Set the Epic to {{lookupIssues}}

Note - You can also remove the initial condition by adding that JQL to the trigger to save a step and improve processing time.

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 14, 2022

Hi @Jenn Sherman 

Yes, and to Mark's answer: Do you expect there to be multiple epics meeting such criteria, and if so what would you do?

If you do not expect this, I recommend a slight change for some insurance...

  • trigger: scheduled with JQL
  • action: lookup issues with JQL to find the epic(s)
  • if/else condition:
    • advanced compare condition: {{lookupIssues.size|0}} equals 1
    • action: edit the issue to set the Epic Link
  • else/if:
    • advanced compare condition: {{lookupIssues.size|0}} equals 0
    • action: add a comment (or mention) that no epic was found
  • else/if
    • advanced compare condition: {{lookupIssues.size|0}} greater than 1
    • action: add a comment (or mention) that multiple epics were found

Kind regards,
Bill

Like Mark Segall likes this

Suggest an answer

Log in or Sign up to answer