Advanced search for has epic link type fails in Jira server
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
Symptoms
Advanced search using 'has Epic' link type such as linkedIssues(issue-100,"has Epic") will fail with errors
Diagnosis
Running the following SQL query against the database results in multiple entries instead of a single entry:
1
SELECT * FROM issuelinktype WHERE linkname = 'Epic-Story Link';
Cause
The cause for this is still being investigated.
Workaround
As a workaround, you can fix this from the database by identifying the legitimate entry for this link-type and deleting the duplicate entries. Take the following steps:
Backup your entire JIRA Database (We always recommend this when fixing issues from the database, so that you can easily rollback any unexpected errors resulting from the changes to the database).
Shutdown JIRA.
Run the following SQL query against your JIRA Database:
1
SELECT * FROM propertynumber where ID = (select id from propertyentry where PROPERTY_KEY = 'GreenHopper.Epic.Default.linktype.id');
If the above SQL Query is throwing error, you may change the "where ID =" to "where ID IN" :
1
SELECT * FROM propertynumber where ID IN (select id from propertyentry where PROPERTY_KEY = 'GreenHopper.Epic.Default.linktype.id');
You should get results similar to this for instance:
+--------+---------------+ | ID | propertyvalue | +--------+---------------+ | 140019 | 10370 | +--------+---------------+ 1 row in set (0.00 sec)
Take note of the propertyvalue field.
Run the following SQL query against the database as well:
1
SELECT * FROM `issuelinktype`;
You may get something similar to the following:
+-------+-------------------+---------------------------+---------------------------------+--------------------+ | ID | LINKNAME | INWARD | OUTWARD | pstyle | +-------+-------------------+---------------------------+---------------------------------+--------------------+ | 10000 | Duplicate | is duplicated by | duplicates | NULL | | 10001 | jira_subtask_link | jira_subtask_inward | jira_subtask_outward | jira_subtask | | 10370 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10471 | Relates | Related by | Relates | NULL | | 10472 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10473 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10474 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10475 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10476 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | | 10477 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story | +-------+-------------------+---------------------------+---------------------------------+--------------------+
Check the results in step 4 for the entry whose value for the column ID, matches the propertyvalue field returned in step 3:
In this case the matching ID is "10370".
Step 3 reveals that the legitimate entry for the Epic-Story Link in the issuelinktype table is the one with ID 10370, and the other are duplicates.
Continue with the resolution section of this related KB article - (Archived) All Epic Link data appears to be lost. The linked article describes a different root cause with the same symptom.
Restart JIRA.
Resolution
The issue is being tracked here: JSWSERVER-10243 - Duplicate Epic-Story Link types should be automatically removed from the IssueLinkType table
Was this helpful?