All Epic Link data appears to be lost

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  • All Epic associations or links appear to be lost. Issues or Stories are no longer associated with their Epics correctly both in the JIRA view and on the Agile boards. This problem may have appeared after an upgrade to JIRA or JIRA Agile.

  • Manually, trying to re-add the Epic link between a Story and it's Epic may appear to work without any error messages thrown.

Diagnosis

Run the following SQL queries against JIRA's database. If at least one of the following SQL queries returns multiple rows then this article is applicable.

SELECT * FROM issuelinktype WHERE linkname = 'Epic-Story Link';

SELECT * FROM propertynumber where id IN (select id from propertyentry where property_key = 'GreenHopper.Epic.Default.linktype.id');

The following is an example of the kind of results that may be returned if the problem exists:

mysql> SELECT * FROM `issuelinktype` WHERE linkname = "Epic-Story Link";
+-------+-----------------+----------+------------+--------------------+
| ID | LINKNAME | INWARD | OUTWARD | pstyle |
+-------+-----------------+----------+------------+--------------------+
| 10030 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10031 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10032 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10033 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10034 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10035 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10036 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10037 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10038 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
| 10039 | Epic-Story Link | has Epic | is Epic of | jira_gh_epic_story |
+-------+-----------------+----------+------------+--------------------+
10 rows in set (0.00 sec)

mysql> SELECT * FROM propertynumber where id IN (select id from propertyentry where property_key = 'GreenHopper.Epic.Default.linktype.id');
+-------+---------------+
| ID | propertyvalue |
+-------+---------------+
| 47972 | 10030 |
| 47973 | 10031 |
| 47974 | 10031 |
+-------+---------------+
3 rows in set (0.01 sec)

If only a single row is returned for both of the queries then this article is not applicable to you.

Cause

This is a database integrity issue. The problem is that there are duplicate entries for the Epic Link type in the database. The issue is related to this bug  GHS-10243 - Getting issue details... STATUS .

Resolution

The broken data would need to be fixed from the database by running the following SQL statements against your JIRA database.

  1. Setup a test JIRA instance, which is a replica of the current production instance. Only proceed to perform the queries on your actual production database after you have confirmed that they resolve the problem on the test JIRA instance.
  2. Shutdown JIRA
  3. Backup your JIRA database
  4. Run the following SQL queries against your JIRA database:
    • The following will change all existing Epic links to use the first Epic-Story link ID on the issuelinktype table, before we proceed to delete the duplicates of the EPIC link type

      UPDATE issuelink SET linktype = xxxxx WHERE linktype IN (SELECT id FROM issuelinktype WHERE linkname = 'Epic-Story Link');
      tip/resting Created with Sketch.

      Remember to replace xxxxx in this query with the first issuelinktype id returned in the first sql query from the Diagnosis section above. In our sample data above the first issuelinktype id is 10030 for instance.

    • The following will remove all the duplicates of the Epic Link type

      DELETE FROM issuelinktype WHERE linkname = 'Epic-Story Link' AND id != xxxxx;
      tip/resting Created with Sketch.

      Remember to replace xxxxx in this query with the first issuelinktype id returned in the first sql query from the Diagnosis section above. In our sample data above the first issuelinktype id is 10030 for instance

    • Execute the following to remove duplicates from JIRA Agile property tables:

      DELETE FROM propertynumber WHERE id IN (SELECT id FROM propertyentry WHERE property_key = 'GreenHopper.Epic.Default.linktype.id') AND id != yyyyy;
      DELETE FROM propertyentry WHERE property_key = 'GreenHopper.Epic.Default.linktype.id' AND id != yyyyy;
      tip/resting Created with Sketch.

      Remember to replace yyyyy with the first id corresponding to our chosen issuelinktype id from the Diagnosis section above. In our sample data above the id corresponding to our issuelinktype id of 10030 is 47972. So we replace yyyyy with 47972 for instance.

5. Restart JIRA 

6. Trigger a manual reindex if Epic Links are still not showing on boards for JIRA to refresh its indexes details from database.

All the queries are tested on MySQL, you may need to adjust the syntax for your specific database if you run into any errors (your local DBA can help fix that easily) 

Contact Atlassian Support (https://support.atlassian.com) if you encounter any specific problem about implementing this resolution.

Last modified on Nov 7, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.