From Bugzilla to OnTime

We have been using Bugzilla as our bug tracking system for quite a long time, but recently my department decided to switch to OnTime by Axosoft because it meets our needs better, for example, OnTime has the ability to separate defects from features and incidents, and to generate professional-looking reports, etc.

After the decision was made, I was assigned to make the switch as smooth as possible. The biggest challenge I had was to find a way to import our Bugzilla entries to the OnTime system.

The only import module in the OnTime system is very raw. It can import a CSV file and can do the field mapping for you, but can’t do any transformation of fields. For example, the priority in Bugzilla is labeled as P1, P2, P3, P4, and P5, but in OnTime it is labeled as Low, Medium, and High. The severity in Bugzilla is from “enhancement” to “blocker”, but in OnTime is from “No Impact” to “High Impact”. Although Bugzilla provides the ability to export bugs to a CSV file, it truncates the description/comments of the bug to the first 60 characters. Therefore, if you generate a CSV file from Bugzilla and feed it to OnTime directly, you will get useless data in OnTime because you will loose everything except the project name (if the project already exists in OnTime because it will NOT create the project for you) and the first 60 characters of the bug description. In another word, the CSV file generated from Bugzilla is worthless and the built-in import module in OnTime is useless, and I have to use a different file format and also have to build my own import utility because OnTime does not support any other formats for import.

Thankfully, Bugzilla can export the complete information of bugs to an XML file, so I can write an application to parse the XML file and then create defects/features in OnTime.

My company’s policy does not allow me to give out the source code of the import utility I have built, so I can only be general on what I did:

  • The version of my Bugzilla is 3.0.2, and the version of my OnTime is OnTime 2007 (7.1.2).
  • It is a .NET 2.0 Windows application and I use OpenFileDialog to browse for the XML file to import.
  • I used OnTime SDK web service to connect to the OnTime database. The SDK is free, but
  • The OnTime SDK does NOT allow you to create new projects, new users, or new customers. So I had to manually enter the projects in OnTime. Make sure the project names in OnTime are the same as the ones in Bugzilla. Yikes, I know, but it will make the import utility simple.
  • Manually add users (developers) in OnTime. Again, they need to match with the ones in Bugzilla. Same reason as above.
  • I imported one project at a time, because it is a lot easier and not every project has bugs in it.
  • I generated two XML files for each project. One is for all “enhancement” bugs to be imported as “Features”, and the other is for all actual bugs to be imported as “Defects”.
  • The XML file generated by Bugzilla has formatting error, and when I tried to open it with XML Notepad, I got an error like this (XMLDocument.Load() method gives the same error):

 XML format error

The second line of the XML file is <!DOCTYPE bugzilla SYSTEM "http://someurl/bugzilla.dtd">. I removed the line and then everything was fine.

  • Since the second line of the generated XML file causes problem, I wrote a small function to delete that line before loading the XML file.
  • Below is the field mapping from Bugzilla bug to OnTime Defect.
XML Tag Name OnTime Defect Field
<creation_ts> DateFound
<bug_status> StatusTypeId
<bug_severity> SeverityTypeId
<priority> PriorityTypeId
<short_desc> Name
<estimated_time> EstimatedDuration, DurationTypeId (minutes, hours, days, or weeks)
<assigned_to> AssignedToId
<reporter> ReportedById
<long_desc> ** Description

<long_desc> **: There might be several <long_desc> tags in a bug node, so you need to loop through all the tags and concatenate the text to get the full description.

  • The field mapping from Bugzilla “enhancement” bug to OnTime Feature is very similar to the above mapping. (Feature does not have SeverityTypeId.)

If you are using Bugzilla and considering moving to OnTime, you should be able to write a small import utility to import all your Bugzilla entries to OnTime with my instructions above. If you need more specific instructions, please let me know.


Leave a Reply

Notify of
Close Bitnami banner