Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-76313

Have the Database Integrity Checker check for inconsistencies in the fieldconfigschemeissuetype table

    XMLWordPrintable

Details

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Inconsistencies in the fieldconfigschemeissuetype table can lead to some unexpected behavior in Jira, like:

      • Other fields showing up in Screens instead of the ones configured
      • Other fields context showing up when trying to edit another's context
      • Admins unable to edit some fields because there are duplicate field configurations (NonUniqueResultException)

      Entries in the fieldconfigschemeissuetype match together fieldconfigscheme and fieldconfiguration for the same custom field, and this is done by each respective table's fieldid column.

      Any entry that doesn't match by the fieldid is a potential issue and may cause the duplicate error:

      select distinct 
        fcsit.id as "fcsit.id", 
        fcsit.issuetype as "fcsit.issuetype", 
        fcs.id as "fcs.id", 
        fcs.fieldid as "fcs.fieldid",
        fc.id as "fc.id", 
        fc.fieldid as "fc.fieldid",
        fc_fix.id as "fc_fix.id",
        fc_fix.fieldid as "fc_fix.fieldid"
      from fieldconfigschemeissuetype fcsit
      join fieldconfigscheme fcs 
        on fcs.id = fcsit.fieldconfigscheme
      join fieldconfiguration fc 
        on fc.id = fcsit.fieldconfiguration
      left join fieldconfiguration fc_fix 
        on fc_fix.fieldid = fcs.fieldid 
        and fc_fix.id not in (select fieldconfiguration from fieldconfigschemeissuetype)
      where fcs.fieldid <> fc.fieldid
      order by fcs.fieldid, fc.fieldid;
      

      The key clause is fcs.fieldid <> fc.fieldid, and the left join to "fc_fix" tries to match an orphaned fieldconfiguration that would likely be the correct one for each mismatching entry.

      This validation was motivated by:

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rmartinez3@atlassian.com Rodrigo Martinez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: