Documentation for JIRA 4.0. Documentation for other versions of JIRA is available too.

Skip to end of metadata
Go to start of metadata

JIRA comes with a means of importing issues from Bugzilla. Unfortunately there are some aspects of this importer that are hardcoded, and require editing of the code to change. For instance:

Changing hardcoded mappings

(related feature requests: JRA-3701, JRA-6403)

The Bugzilla importer assumes a fixed set of Bugzilla severities, resolutions, and JIRA statuses :

Changing imported usernames

(related feature request: JRA-3890)

By default, the Bugzilla importer creates usernames which are equal to the email addresses of reporters (which act as the Bugzilla logins). If instead you wish to infer a shorter username from the email (eg. 'joe' from 'joe@company.com'), you can do this by modifying this code:

Modifying the importer code

Get the importer source.

The Bugzilla importer code can be obtained from the JIRA documentation website (the Importing data from Bugzilla page), at the bottom. A direct link to the latest source is:

BugzillaImportBean.java

Compile the source

In JIRA Standalone:

  1. Create a directory, external-source/src
  2. Copy BugzillaImportBean.java to external-source/src
  3. Download and install Apache Ant if you don't already have it.
  4. Compile BugzillaImportBean.java into JIRA Standalone.

Please note that you may need to restart JIRA Standalone in order for your changes to be detected.

For example:

jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone$ mkdir external-source/src
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone$ cd external-source/src
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/src$ wget -q 'http://www.atlassian.com/software/jira/docs/latest/importers/BugzillaImportBean.java'
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/src$ ls
BugzillaImportBean.java
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/src$ cd ..
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source$ ant
Buildfile: build.xml

prepare:
    [mkdir] Created dir: /tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/etc
    [mkdir] Created dir: /tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/lib

compile:
    [javac] Compiling 1 source file to /tmp/atlassian-jira-enterprise-3.4.2-standalone/atlassian-jira/WEB-INF/classes
    [javac] Note: /tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/src/BugzillaImportBean.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: /tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source/src/BugzillaImportBean.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL
Total time: 3 seconds
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2-standalone/external-source$

In JIRA Webapp/WAR edition

If you have the webapp edition of JIRA, copy BugzillaImportBean.java into src/, and then run build.sh/build.bat as normal:

jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2$ cd src
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2/src$ wget -q 'http://www.atlassian.com/software/jira/docs/latest/importers/BugzillaImportBean.java'
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2/src$ cd ..
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2$ ./build.sh
Buildfile: build.xml

init:

compile:
Created dir: /tmp/atlassian-jira-enterprise-3.4.2/tmp/build/war
Created dir: /tmp/atlassian-jira-enterprise-3.4.2/dist-generic
Created dir: /tmp/atlassian-jira-enterprise-3.4.2/dist-tomcat
Copying 3492 files to /tmp/atlassian-jira-enterprise-3.4.2/tmp/build/war
Copied 2 empty directories to /tmp/atlassian-jira-enterprise-3.4.2/tmp/build/war
Copying 1 file to /tmp/atlassian-jira-enterprise-3.4.2/tmp/build/war
Compiling 1 source file to /tmp/atlassian-jira-enterprise-3.4.2/tmp/build/war/WEB-INF/classes
Note: /tmp/atlassian-jira-enterprise-3.4.2/src/BugzillaImportBean.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /tmp/atlassian-jira-enterprise-3.4.2/src/BugzillaImportBean.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

war:
Building jar: /tmp/atlassian-jira-enterprise-3.4.2/dist-generic/atlassian-jira-3.4.2.war
Building jar: /tmp/atlassian-jira-enterprise-3.4.2/dist-tomcat/atlassian-jira-3.4.2.war
Copying 1 file to /tmp/atlassian-jira-enterprise-3.4.2/dist-tomcat

--------------------------------------------------
Deployable WARs generated:

TOMCAT:  /tmp/atlassian-jira-enterprise-3.4.2/dist-tomcat/atlassian-jira-3.4.2.war
GENERIC: /tmp/atlassian-jira-enterprise-3.4.2/dist-generic/atlassian-jira-3.4.2.war


See http://www.atlassian.com/software/jira/docs/latest/servers/ for install instructions
--------------------------------------------------


BUILD SUCCESSFUL
Total time: 25 seconds
jturner@teacup:/tmp/atlassian-jira-enterprise-3.4.2$

Then deploy the webapp in your app server.

  • No labels