Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-34338

Importing individual projects from an XML backup can lead to Agile charts being wrong.

    XMLWordPrintable

    Details

      Description

      Summary

      When importing a project, issue status ids are mapped from the old IDs to new IDs based on the issue status names.
      This leads to the Agile Burndown, Cumulative Flow Diagram charts becoming wrong, as the change history entries are referring to different or nonexistent issue statuses.

      Steps to Reproduce

      1. Configure Source JIRA with <STATE> and do multiple transitions.
      2. Make xml backup.
      3. Import xml backup into Target JIRA
      4. Check changeitem table oldvalue and newvalue values

      Expected Results

      The change history oldvalue and newvalue fields are update to match Target JIRA.

      Actual Results

      When this is done, the change history oldvalue and newvalue fields are not updated.

      Notes

      I can see two ways of fixing this:

      • a. Change Agile to look at changeitem.oldstring and changeitem.newstring instead of changeitem.oldvalue and changeitem.newvalue when it's determining status change history
      • b. Change the project import process to do the equivalent of:
        update changeitem set newvalue=(select id from issuestatus where pname=changeitem.newstring) and field='status' and fieldtype='jira' and groupid in (select id from changegroup where issueid in (select id from jiraissue where project = :projectid));
        update changeitem set oldvalue=(select id from issuestatus where pname=changeitem.oldstring) and field='status' and fieldtype='jira' and groupid in (select id from changegroup where issueid in (select id from jiraissue where project = :projectid));
        

      Workaround

      Update DB table changeitem manually for each state: <STATE> .

      UPDATE changeitem
      SET oldvalue = '<TARGET_STATE_ID>'
      WHERE fieldtype = 'jira'
        AND FIELD = 'status'
        AND oldvalue = '<SOURCE_STATE_ID>'
        AND oldstring LIKE "<STATE>%"
      
      UPDATE changeitem
      SET newvalue = '<TARGET_STATE_ID>'
      WHERE fieldtype = 'jira'
        AND FIELD = 'status'
        AND newvalue = '<SOURCE_STATE_ID>'
        AND newstring LIKE "<STATE>%"
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              nigel.williams Nigel Williams
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated: