Advanced search for has epic link type fails in Jira server

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

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:

  1. 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).

  2. Shutdown JIRA.
  3. Run the following SQL query against your JIRA Database:

    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" :

    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.

  4. Run the following SQL query against the database as well:

    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 |
    +-------+-------------------+---------------------------+---------------------------------+--------------------+
  5. 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".

  6. 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.
  7. Continue with the resolution section of this related KB article - All Epic Link data appears to be lost. The linked article describes a different root cause with the same symptom.
  8. Restart JIRA.

Resolution

The issue is being tracked here:  GHS-10243 - Getting issue details... STATUS

Last modified on Sep 25, 2019

Was this helpful?

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