Multiple entries for the same issue type under "Default Issue Type Scheme"

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem

There are multiple entries for the same issue type on the Default Issue Type Scheme and it is not possible to delete or remove those through the interface.

Diagnosis

Run this query to confirm there are duplicate issue types on the Default Issue Type Scheme. It will show how many entries exist for each issue type.

SELECT COUNT(oc.id), it.pname FROM optionconfiguration oc JOIN issuetype it ON oc.optionid = it.id WHERE oc.fieldconfig = '10000' GROUP BY it.pname HAVING COUNT(it.id) > 1;

Cause

Unknown, at the moment. It could be caused by direct manipulation of JIRA's database or any other kind of data corruption.

Resolution

  1. Shutdown JIRA;
  2. Check for the highest ID among the multiple entries:

    SELECT it.pname, MAX(oc.id) FROM optionconfiguration oc JOIN issuetype it ON oc.optionid = it.id WHERE oc.fieldconfig = 10000 GROUP BY it.pname HAVING count(it.id) > 1;
  3. Delete entries with those IDs from the optionconfiguration table:

    DELETE FROM optionconfiguration WHERE id IN (SELECT MAX(oc.id) FROM optionconfiguration oc JOIN issuetype it ON oc.optionid = it.id WHERE oc.fieldconfig = 10000 GROUP BY it.pname HAVING count(it.id) > 1);

    It is extremely important that you must take a snapshot/backup of the database prior to executing the DELETE queries onto the production database.

  4. Repeat steps 2 and 3 until step 1 returns an empty set. 
    (info) This is required in some cases where we have more than 2 entries for each issue type;
  5. Start JIRA and check if the multiple entries are gone;

Last modified on May 9, 2018

Was this helpful?

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