Automation for Jira - The branch "for stories" fails with the error "Field XXXX does not exist or you do not have permission to view it"

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

An automation rule configured with the branch For Stories (or other issues in Epic) fails with the error Field 'Epic Link' does not exist or you do not have permission to view it. You can find the full error below:

1 2 3 4 5 6 Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues: SCRUM-25: "("Epic Link" = SCRUM-25 or (parent = SCRUM-25 and issuetype in standardIssueTypes())) AND (project in (10000))" - Field 'Epic Link' does not exist or you do not have permission to view it.
Actions on issues that belong to an epic

Diagnosis

Go to the page ⚙ > Issues > Custom Fields, and search for the field Epic Link (please note that, this field might have been renamed by a user to a different name, so it is possible that you have to search for another field name)

  • Normally, this field should show as locked, because is it a native Jira Software field that is used for Epic-Story linking:

epic link custom field
Epic link field unlocked
  • If you see that this Custom Field is not showing as locked, click on ... > Edit next to this field and check if it has a Search Template.

  • If it is set to None, then this KB article is relevant and you can move on to the Solution section

Edit epic link

Cause

When using the branch For Stories (or other issues in Epic) in an automation rule, the rule will execute the JQL query below in order to find the stories and other issues related to the issue ABC-123:

1 ("Epic Link" = ABC-123 or (parent = ABC-123 and issuetype in standardIssueTypes())) AND (project in (10000))

In order to be able to perform the search "Epic Link" = ABC-123, the field Epic Link needs to be searchable, which means that this field needs to be associated to a search template. If the search template is set to None for this field, then the search will fail, and the error Field 'Epic Link' does not exist or you do not have permission to view it will be thrown in the audit logs.

Solution

To fix this issue, edit the custom field Epic Link via the page ⚙ > Issues > Custom Fields, and set its Search Template to Jira Software Epic Link Searcher:

Update search template

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.