Automation - Link story to epic
Asked by Lakin Duplessis:

I am currently using an automation to create an epic and stories every month. I have the automation setup like this:

Trigger: When: Scheduled - The last day of the month

Then: Create Epic

And: Create Story 1

And: Create Story 2

And: Create Story 3

I need to automatically link the stories to the triggered epic once they are created. I have tried every possible option to copy the epic link and epic name from the epic to the stories within the "Choose fields to set option" and nothing works. Can anyone help?

![Screenshot 2022-12-20 161236.png](https://community.atlassian.com/t5/image/serverpage/image-id/231445iFC695D48DFDB2351/image-size/large?v=v2&px=999 "Screenshot 2022-12-20 161236.png")


Answers:
author: Vamsi Kandala
body: Hi [@Lakin Duplessis](/t5/user/viewprofilepage/user-id/5092243)

Assuming you are using Cloud version.

I am enclosing the same steps mentioned by [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) but with little change:

* trigger: scheduled
* action: create issue (for your epic)
* branch: to most recently created issue
  * action: add story, with the epic link "**Copy from trigger issue**" as this will refer to the branched-to epic
  * repeat...

Enclosed the screenshots here:

![Epic and stories.png](https://community.atlassian.com/t5/image/serverpage/image-id/231671i914E8B3CC31EC314/image-size/large?v=v2&px=999 "Epic and stories.png")![Epic ticket.png](https://community.atlassian.com/t5/image/serverpage/image-id/231672i2FC5B51CD6D23958/image-size/large?v=v2&px=999 "Epic ticket.png")

Hope this helps.

Thanks,  
Vamsi

comments: author: Lakin Duplessis
body: Thank you for your reply! I set my automation per your steps above, but it is still not linking the Epic to the Story. I ran the rule, and when I check the Story on the board, it still requires a manual step to link the Story to the Epic.![Screenshot 2022-12-22 105915.png](https://community.atlassian.com/t5/image/serverpage/image-id/231769iD2281D80432DB931/image-size/large?v=v2&px=999 "Screenshot 2022-12-22 105915.png")![Screenshot 2022-12-22 105959.png](https://community.atlassian.com/t5/image/serverpage/image-id/231770iB166A9B01E1665FC/image-size/large?v=v2&px=999 "Screenshot 2022-12-22 105959.png")


author: Vamsi Kandala
body: Hi [@Lakin Duplessis](/t5/user/viewprofilepage/user-id/5092243)

Can you send me the screenshot of how you configured the rule for creating the 'Epic' issue type? Are you providing and setting the value for 'Epic Name' field also?

Thanks,  
Vamsi


author: Bill Sheboy
body: Hi [@Lakin Duplessis](/t5/user/viewprofilepage/user-id/5092243) -- Welcome to the Atlassian Community!

Please try branching to the new epic before adding the new stories. For example:

* trigger: scheduled
* action: create issue (for your epic)
* branch: to most recently created issue
  * action: add story, with the epic link (parent) of {{issue.key}} as this will refer to the branched-to epic
  * repeat...

Kind regards,  
Bill

comments: author: Lakin Duplessis
body: Hi Bill. Thanks for your reply. That didn't work either. :(


author: Bill Sheboy
body: Would you please post a new image of your current rule and the audit log details, and explain what is not working as you expect? For example, are the issues created and not linked, or something else is happening? Thanks!


author: Lakin Duplessis
body: I posted my current rule in the comment above from Vamsi.