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

issue_version and comment_version missing data from project import

XMLWordPrintable

      Problem

      During the import of new data Jira doesn't assign a version to issue and comment entities , during the reindexation it expects that all the entities have versions since all the data will come from :

      • XML restore (Cloud backup) where UpgradeTask_Build900000 will populate the tables
      • Or the current data was already processed by the upgrade task
        Therefore during the reindexation It does not bump the version or generate it instead the following warning is thrown because the newly inserted data does not have a version.
      [c.a.j.issue.index.DefaultIssueIndexer] ISSUE with id=XXXX should have a version by now
      

      Environment

      Jira 9.X

      Steps to Reproduce

      • Clear issue_version and comment_version
        • Alternatively port the data from a different instance
      • Run full or project reindexing

      Expected Results

      • Jira will populate a version for the tickets and comments that still don't have an initial version
      • Data is indexed and searchable

      Actual Results

      • Jira alerts about missing version for the processed entity since there is no matching entries in their corresponding tables
      [c.a.j.issue.index.DefaultIssueIndexer] ISSUE with id=XXXX should have a version by now
      
      • Data is indexed and searchable

      Workaround

      Insert missing initial issue versions

      insert into issue_version
        select id, null,  updated, 1, 'N' 
        from jiraissue
        where id not in (
            select issue_id
            from issue_version
          );
      

      Insert missing initial comment versions

      insert into comment_version
        select id, issueid,  updated, 1, 'N' 
        from jiraaction
        where actiontype = 'comment'
          and id not in (
            select comment_id
            from comment_version
          );
      

      Notes

      The insertion time will depend on the size of the missing data in the versions and entities tables don't worry if it takes more than a few seconds.

      IMPORTANT

      Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

              1e1912138bc7 Tomasz Majcher
              f0ea184c9b1c Mohamed Kouki (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: