History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRA-8967
Type: Improvement Improvement
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Jeff Turner [Atlassian]
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JIRA

Bugzilla and Mantis importers lose information (hardcoded statuses, resolutions, priorities)

Created: 08/Jan/06 06:38 PM   Updated: 16/Jan/06 06:31 AM
Component/s: Import / Export
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Reference
 

Participants: Alexander Weiss and Jeff Turner [Atlassian]
Since last comment: 130 weeks, 5 days ago
Labels:


 Description  « Hide
Bugzilla and Mantis have more fine-grained options for things like statuses, resolutions and priorities. JIRA's importer is hardcoded for the JIRA defaults, which aren't as fine-grained, so some information is lost during the import.

Eg. RESOLVED and VERIFIED Bugzilla issues both become 'Resolved' in JIRA, and issues with 'Major' and 'Normal' priorities both get priority 'Major'.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner [Atlassian] - 08/Jan/06 06:49 PM
Here is a workaround describing how to modify the importer to use a new 'Verified' status:

In BugzillaImporterBean.java, things are hardcoded in a map:

static
        {
            // bugzilla's priorities mapping to JIRA priorities
            priorityMap.put("blocker", "" + IssueFieldConstants.BLOCKER_PRIORITY_ID);
            priorityMap.put("critical", "" + IssueFieldConstants.CRITICAL_PRIORITY_ID);
            priorityMap.put("major", "" + IssueFieldConstants.MAJOR_PRIORITY_ID);
            priorityMap.put("normal", "" + IssueFieldConstants.MAJOR_PRIORITY_ID);
            priorityMap.put("enhancement", "" + IssueFieldConstants.MINOR_PRIORITY_ID);
            priorityMap.put("minor", "" + IssueFieldConstants.MINOR_PRIORITY_ID);
            priorityMap.put("trivial", "" + IssueFieldConstants.TRIVIAL_PRIORITY_ID);

            // bugzilla resolutions mapping to JIRA resolutions
            resolutionMap.put("", null);
            resolutionMap.put("FIXED", "" + IssueFieldConstants.FIXED_RESOLUTION_ID);
            resolutionMap.put("INVALID", "" + IssueFieldConstants.INCOMPLETE_RESOLUTION_ID);
            resolutionMap.put("WONTFIX", "" + IssueFieldConstants.WONTFIX_RESOLUTION_ID);
            resolutionMap.put("LATER", "" + IssueFieldConstants.WONTFIX_RESOLUTION_ID);
            resolutionMap.put("REMIND", "" + IssueFieldConstants.WONTFIX_RESOLUTION_ID);
            resolutionMap.put("DUPLICATE", "" + IssueFieldConstants.DUPLICATE_RESOLUTION_ID);
            resolutionMap.put("WORKSFORME", "" + IssueFieldConstants.CANNOTREPRODUCE_RESOLUTION_ID);
            resolutionMap.put("NEEDTESTCASE", "" + IssueFieldConstants.INCOMPLETE_RESOLUTION_ID);

            // bugzilla status mapping to JIRA status
            statusMap.put("UNCONFIRMED", "" + IssueFieldConstants.OPEN_STATUS_ID);
            statusMap.put("NEW", "" + IssueFieldConstants.OPEN_STATUS_ID);
            statusMap.put("ASSIGNED", "" + IssueFieldConstants.OPEN_STATUS_ID);
            statusMap.put("REOPENED", "" + IssueFieldConstants.REOPENED_STATUS_ID);
            statusMap.put("RESOLVED", "" + IssueFieldConstants.RESOLVED_STATUS_ID);
            statusMap.put("VERIFIED", "" + IssueFieldConstants.RESOLVED_STATUS_ID);
            statusMap.put("CLOSED", "" + IssueFieldConstants.CLOSED_STATUS_ID);

            // workflow Mappings
            wfStepMap.put("1", new Integer("1"));
            wfStepMap.put("2", new Integer("2"));
            wfStepMap.put("3", new Integer("3"));
            wfStepMap.put("4", new Integer("5"));
            wfStepMap.put("5", new Integer("4"));
            wfStepMap.put("6", new Integer("6"));

            wfStatusMap.put("1", "Open");
            wfStatusMap.put("3", "In Progress");
            wfStatusMap.put("4", "Reopened");
            wfStatusMap.put("5", "Resolved");
            wfStatusMap.put("6", "Closed");
        }

Say you wish to preserve the VERIFIED status. To do this:

  1. Run the Bugzilla importer up to the step where one selects the project by name
  2. In a new window, create a project with the name of the project you wish to import
  3. Create a 'Verified' status and workflow using it, and assign this (via a workflow scheme in Enterprise) to your project
  4. Check the ID of the 'Verified' status. The ID can be seen in the URL for the 'edit' link on the status page, eg. /secure/admin/EditStatus!default.jspa?id=10000
  5. Check the ID of the 'Verified' workflow step in your workflow. This is shown as a number in brackets alongside the step in the workflow editor. Eg. "Verified (7)".
  6. Edit BugzillaImportBean.java, locate the section above and add the following to the relevant section:
    statusMap.put("VERIFIED", "10000");
    wfStepMap.put("10000", new Integer("7"));

    where 10000 is the status ID and 7 is the step id.

  7. Recompile BugzillaImportBean.java (if using JIRA Standalone, see external-source/README.txt); otherwise the building from source docs.
  8. Run the importer again. Correct the project key when prompted (it should be that of your existing project).
  9. After the import, check that issues are in the Verified status.

Alexander Weiss - 12/Jan/06 05:37 PM
Hi Jeff,

unfortunatley this does not work correctly: The 'Verified' status will be transmitted correctly but the entries will not get there original resolution; they just get nothing (means keep 'UNRESOLVED', which then causes trouble in JIRA). THe problem does not occure when I leave the original logic with Verified will become Resolves!

What is going wrong?

I've tried alos to add in addtion to your 2 lines following

wfStatusMap.put("7", "Verified");

Jeff Turner [Atlassian] - 12/Jan/06 08:49 PM
Ah right, if "Verified" issues have a resolution, you'll also need to modify this section:
// make sure no resolution if the issue is unresolved
        if (!"5".equals(jiraBugStatus) && !"6".equals(jiraBugStatus))
            issue.set(IssueFieldConstants.RESOLUTION, null);
        else
            issue.set(IssueFieldConstants.RESOLUTION, bugzillaMappingBean.getResolution(resultSet.getString("resolution")));

and add {{ && !"7".equals(jiraBugStatus)}} to the condition.

Cheers,
Jeff


Alexander Weiss - 16/Jan/06 06:31 AM
Hi Jeff,

the last mentioned code-section is indeed the location which has to be adapted in addition to your comment http://jira.atlassian.com/browse/JRA-8967#action_48935 but not as I wrote before with

&& !"7".equals(jiraBugStatus)

but with

&& !"10000".equals(jiraBugStatus)
regarding your example above where the status id of 'Verified' is 10000.

The if-clause then has to look like:

if (!"5".equals(jiraBugStatus) && !"6".equals(jiraBugStatus) && !"10000".equals(jiraBugStatus))
      issue.set(IssueFieldConstants.RESOLUTION, null);
else
      issue.set(IssueFieldConstants.RESOLUTION, bugzillaMappingBean.getResolution(resultSet.getString("resolution")));