Jira Automation Linking an issue on creation to an existing Epic
Asked by Ariel Altaras:

I am using Jira Data Center. I've created this automation and according to other questions I've read it should work, but I am getting an error each time I create a new issue. I previously tried choosing the Epic Link field in the dropdown, which also had this error, so I switched to the Advanced JSON since I saw that others had success with that.  

The rule is limited to a single project, the one containing the referenced Epic. The Epic Link field is present on both the Create and Edit screens for the issue type.  

![rule.png](https://community.atlassian.com/t5/image/serverpage/image-id/309561iE2B4D7318FA26D3B/image-size/large?v=v2&px=999 "rule.png")![Screenshot 2024-02-29 at 4.23.24?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/309562i4DBCCC9B829B4AF1/image-size/large?v=v2&px=999 "Screenshot 2024-02-29 at 4.23.24?PM.png")


Answers:
author: Filipi Lima
body: Hi, all!  

I assisted Ariel and the issue was related to the Actor not having the permission to perform the update.  

It's one of the scenarios covered here:  

<https://confluence.atlassian.com/automationkb/automation-for-jira-reporting-unknown-fields-set-during-edit-they-may-be-unavailable-for-the-project-type-1130727699.html>  

Cheers!

comments: author: Bill Sheboy
body: Thanks, [@Filipi Lima](/t5/user/viewprofilepage/user-id/4230940) !


author: Bill Sheboy
body: Hi [@Ariel Altaras](/t5/user/viewprofilepage/user-id/3777398)

One possible cause of that symptom is the Issue Created trigger can fire so quickly that some of the issue data may not be available for the rule to use.

The work-around / fix is to always add the Re-fetch Issue action immediately after the Issue Created trigger. This will slow down the rule a bit, reloading the issue's data before proceeding with the other steps.

Kind regards,  
Bill

comments: author: Ariel Altaras
body: Thanks for the tip. I tried adding a Re-fetch, but I'm still getting the same error.


author: Bill Sheboy
body: Considering your issue hierarchy, if you manually create an issue of type Vulnerability with the UX page can you set the Epic Link field?


author: Ariel Altaras
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) Yes I can, and I can edit a manually created issue to put it under the same Epic. I am actually manually creating the issues to test but not setting the Epic Link field - they are usually created through the API.


author: John Funk
body: Hi Ariel,

You should be using the Parent field now instead of Epic Link.

comments: author: Ariel Altaras
body: Hi John,

Hmm... I'm on version 9.4.15 and I don't see a Parent field. I do see Parent Link, but when I try to set that I get the following error:  

"Unknown fields set during edit, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -  
Parent Link (customfield_15401)"  

Also it seems that field is only on the Epic issue type, not the Vulnerability issue type which is the trigger issue.


author: John Funk
body: Hmm, surprised that version doesn't have the Parent field. So, yes, I would think you would go with the Epic Link field.

Make sure the Epic Link field is on the Edit screen - that is most likely the error.


author: Ariel Altaras
body: The Epic Link field is on both the Create and Edit screens.


author: John Funk
body: Well, just grasping now, but maybe use customfield_11003 instead of the Epic Link name?