Bugzilla Installation & User Guide

Print this topicEmail this topicSave as PDF

Installation & User Guide

1.0 Introduction

The Rally Connector for Bugzilla allows customers to use Rally for Agile lifecycle management while still using Bugzilla for management of bugs. The connector provides synchronization capability between Bugzilla and Rally through four services, described below.

2.0 Overview of features

The Rally Connector for Bugzilla runs as a Ruby script on a machine inside your network. The connector is configured via an XML file. A log file is created to track all changes made in Rally and Bugzilla by the connector. The connector requires that a custom field exists in each system to store the unique id of the linked objects in the other system. The connector copies fields from Rally and/or Bugzilla based on a field mapping that the user has specified in their configuration file. Standard and custom fields can be mapped between the two systems.

The connector provides four services to synchronize objects between Rally and Bugzilla:

  • Copy bugs created in Bugzilla to Rally work items
  • Copy work items created in Rally to Bugzilla bugs
  • Update Rally work items based on changes made to Bugzilla bugs
  • Update Bugzilla bugs based on changes made to Rally work items

The configuration file specifies which services to run, and in what order.

It is important to recognize that the data models of Rally and Bugzilla are not identical and, as such, the two systems are only partially compatible. We recommend you take some time to identify the key data items you want to track in both systems and consider what you want the policy to be as far as having a primary system of record. You'll see specific information later in this document discussing some of the trade-offs to be considered and some potential approaches.

3.0 Software and hardware requirements

Click the Contact Support link at the bottom of any page in Rally to open a support case to obtain the Rally Connector for Bugzilla. Once you have received a response and obtained the installation package, proceed with the following tasks.

3.1 Software and hardware requirements

The following are the hardware and software requirements to install and run the Rally Connector for Bugzilla:

  1. A Rally subscription.
  2. If using a Windows machine, a Win32 OS (we do not support 64-bit at this time)
  3. Latest stable version 3.6 (or greater) of Bugzilla using UTF-8 (default on new installations) with Bugzilla REST API Version 0.9. To install the Bugzilla REST API, review the 'Bugzilla REST API: Your Installation' section for more information.
  4. Ruby 1.9.2 (preferred) or Ruby 1.9.1 (this connector will not work with Ruby 1.8.x).
    • To install Ruby on Windows, we recommend the "one-click installer" which can be found at http://rubyinstaller.org/downloads/. Click on the Ruby 1.9.2-p290 link to download the installer.
    • You must install as an administrator on Windows for the path and environment variable settings to take effect (check this option during the install).
    • By default, Ruby 1.9.2 is installed in the C:\Ruby19 directory.

3.2 Pre-installation checklist

  • Access to a "test environment/installation" of Bugzilla with the Bugzilla REST API installed
  • Rally administrator privileges are needed for setup but only user access needed to run the connector.
  • Proxy server details if the machine used to run the connector uses a proxy server

4.0 Installation

4.1 Basic installation steps

  1. Install the connector (run the installer or extract the zip).
  2. Make configuration changes in Rally and the Bugzilla system.
  3. Edit the bz_config.xml to reflect your environment.
  4. Run rally2_bugzilla_connector program (.rb or .exe) to start the synchronization process.

4.2 Install the connector

(Optional) If you use a proxy server to access Rally, you will need to set the http_proxy environment variable. On Windows, right-click My Computer and select Properties. Select the Advanced tab and then click Environment Variables. Click New under System Variables and enter http_proxy as the full HTTP URL, such as http://www-cache:8000. You may need to restart your system in order for the change to take effect.

Installation for Windows

Double-click the RallyConnectorforBugzillaInstall-<version>.exe to open the install wizard. Follow the prompts to complete the installation.

install

The Windows installer will install the following files (by default in C:\Program Files\RallyConnectorforBugzilla):

  • rally2_bugzilla_connector.exe - Executable to run the connector.
  • bz_config.xml - Sample configuration file.
  • WinTail.exe* - Utility to tail the log file output for debugging purposes.
  • startbz.bat - Batch file that automatically runs the connector and shows the log file; useful for testing.

*WinTail is a free text file tail utility for Windows, generously made available by Bare Metal Software Pty Ltd. for redistribution without restriction. We have found it to be far superior to Notepad and other text editors for watching log files in real time as they are updated by the connector.

Installation for Linux and Mac

  1. Unzip and extract the contents of the zip file locally on your machine (e.g. C:\rally). The contents of the zip include these files:
    • <connector_name>_config.xml - Sample configuration file.
    • rally2_<connector_name>_connector.rb - Ruby file that you will use to run the connector.
    • yeti-x.x.x.gem - gem (library) that includes all of the code needed for the connector.
    • WinTail.dat - Rename from .dat to .exe due to the fact we can't deliver a .exe with the zip.  Utility to tail the log file output for debugging purposes.
  2. Install the required Ruby gems by entering:
  3. Using a proxy:
  4. Answer yes to any questions about installing required dependencies.
  5. Install the yeti gem by navigating to wherever you extracted the zip file:

4.3 Make configuration changes in Rally and Bugzilla

Create an External ID field in Rally

  1. Log into Rally as a Workspace or Subscription administrator.
  2. Go to Setup → Workspaces & Projects.
  3. Click on the appropriate Workspace that you wish to map to Bugzilla. This will take you to the Detail page for the given Workspace.
  4. Click on Work Products & Fields and ensure the Work Product Type selected is Defect or whatever work item you are mapping.
  5. Click Actions → New Field.
  6. Enter a name of BugzillaID, display name of BugzillaID (name and display name must match), and type of String. Note: You can choose a different name for the custom field in Rally, but the name you choose must conform to these rules:
    • Begin with an uppercase letter
    • Less than 41 characters (40 is the maximum for display name)
    • No underscores, dashes, or spaces.

Make note of the name of this field. Once you start using the connector, this will contain the external id of the Bugzilla entity you are mapping between the two systems.

Create an External ID custom field in Bugzilla

Contact your Bugzilla administrator to perform these updates:

  1. Click on AdministrationCustom Fields links.
  2. Click Add a new custom field link.
  3. Enter a Name, Description.
  4. Select Free Text as the Type.
    caution_icon Caution: Do not specify this field as the default type of BugID as that type will result in the connector being unable to identify and select bugs for transfer to Rally.
  5. Select Can be set on bug creation.
  6. Click the Create button.

Make note of the name of this field (for example, cf_field_name). All Bugzilla custom fields begin with the 'cf_' prefix. You will enter this value (cf_*) in the <ExternalIDField> element of the configuration file under the <BugzillaConnection> section.

caution_icon Caution: External ID field is not searchable for existing bugs
When you create the custom field for External ID, it is added to any existing bugs in the database, but its value for those bugs is null. Unfortunately, the Bugzilla web service API does not permit querying for fields whose contents is null, so the connector service which updates bugs from Bugzilla to Rally will never find them.

There is an existing Bugzilla defect (Bug 345194) which is a request to add null support to Bugzilla's query capabilities. Until that bug is fixed, the only workaround we have found for allowing existing bugs to be found (for example, bugs created before the External ID custom field was added), is to use SQL to update the database directly, setting the custom field equal to the empty string. For example:

(Optional) Create a CrosslinkUrlField in Rally

It can be useful to have a clickable link in the Rally artifact that will bring up the corresponding bug in Bugzilla. The CrosslinkUrlField element in the RallyConnection section allows you specify the name of field that will contain this link.

Use the same process in Rally as for the Rally External ID above.

  • We suggest a field name of BugzillaLink
  • Must be a String type of field
  • Make note of the name of this field for when you customize the RallyConnection section of your connector config file (see section 4.1.3)

(Optional) Create a CrosslinkUrlField in Bugzilla

Although Bugzilla doesn't have a weblink field, it can still be useful to have the URL to the corresponding item in Rally, stored in a field of type FreeText. A text selection of the URL and a right click of the URL to open the link in a new tab or window will then show the Rally item. Use the same process in Bugzilla as for the Rally External ID above. Note:

  • We suggest a field name of RallyURL
  • Make the field a FreeText type field
  • Make note of the name of this field for when you customize the Bugzilla section of your connector config file (see section 4.1.3)

4.4 Edit the configuration file

The configuration file was part of the delivered zip file and should be in the same directory where you extracted the Ruby gem. For Bugzilla, the default configuration file has a name of bz_config.xml. We recommend making a backup copy of the bz_config.xml in case you need to reference a valid configuration file later.

Edit bz_config.xml by entering the appropriate values between each begin and end tag.

Each major section is surrounded by a tag to delineate that section. In the example above, here is a description of each section:

  • RallyConnection
    Defines the connection information for Rally, including Rally URL, user, password, and so on.
  • BugzillaConnection
    Defines the connection information for Bugzilla, including the Bugzilla URL, project, artifact type, and so on.
  • Connector
    Defines the field mapping between the two systems. Generally, strings should be mapped to strings, integers to integers, and so on.
  • ConnectorRunner
    Specifies the services to run and how often to run them.

Definition of tags in configuration file

Below is a more detailed explanation of each tag section in the configuration file:

Specification of elements contained in the RallyConnection section

<RallyConnection>

Tag Name Description Sample Values
<Url>
Required
Server used to connect to Rally (excluding the HTTPS prefix, as the connector adds "https://" to whatever is specified). sandbox.rallydev.com
rally1.rallydev.com
myRally.mydomain.com
192.168.23.24
<User>
Required
Login name for user to make the Web Services requests to create/update work items in Rally. user@company.com
<Password>
Required
Password associated with the above <User>. Note: The connector will encode this password string and update it in the configuration file as to avoid clear-text passwords being stored. mypassword
<WorkspaceName>
Required
Workspace in Rally you want to copy/update work items. My Workspace MyWorkspace
<Projects>
Required
Contains a list of Project tags. Each tag refers to one Rally project that will be used when finding new Rally work items to copy to the other system. For updating work items from Rally to the other system, all projects in <WorkspaceName> are considered. At least one Rally project must be specified in this tag. <Project>Rally1</Project>
<Project>Rally2</Project>
<ArtifactType>
Required
Type of artifact you want to create/update in Rally. (Defect, defect),
(Story, UserStory, HierarchicalRequirement), TestCase
<ExternalIDField>
Required
Rally custom string field (name and display name must be identical) that stores the unique id for the other system. Refer to the Create an External ID Field in Rally section above. BugzillaID
<CrosslinkUrlField> Rally custom field containing a hyperlink to the corresponding bug in Bugzilla. BugzillaLink
<CopySelectors>
   <CopySelector>
Criteria to use when finding new Rally artifacts to copy to Bugzilla. Multiple criteria are ANDed together. An individual selector specification has the form:
<field><relation><value>,
where:
<field> is the name of a Bugzilla bug field
<relation> is one of =, !=, gt, lt, gte, lte
<value> is a valid value for the <field>.
<CopySelector>
Status = Open
</CopySelector>
<CopySelector>
Priority = Low
</CopySelector>
<UpdateSelectors>    <UpdateSelector> Criteria to use when finding existing Rally artifacts to be updated in Bugzilla. Multiple criteria are ANDed together. An individual selector specification has the form:
<field> <relation> <value>
where:
<field> is the name of a Bugzilla bug field
<relation> is either = or !=
<value> is a valid value for the <field>.
<UpdateSelector>
Release != alpha
</UpdateSelector>
</RallyConnection>

Tip:Escape special characters contained in a Rally Workspace or Project name that are markup sensitive. For example:

"&" ampersand becomes "&amp;"
">" greater than becomes "&gt;"
"<" less than becomes "&lt;"

Example: "Research & Development" → "Research &amp; Development"

Specification of elements contained in the BugzillaConnection section

<BugzillaConnection>

Tag Name Description Sample Values
<Url>
Required
Bugzilla server name (or IP address) and port. Syntax is server:port mybzserver:8080
<User>
Required
User to make the API requests to create/update entities in Bugzilla. myuser@company.com
<Password>
Required
Password for user to make the API request to create/update entities in Bugzilla. Note: The first time the connector runs, it will encode the password so it is not saved in plain text. mypassword
<ArtifactType>
Required
Entity name for the entities you want to create/update in Bugzilla. bug
<IDField>
Required
Bugzilla custom field used to store the unique id of a bug, usually id. id
<ExternalIDField>
Required
Bugzilla custom field of type 'Free Text' that stores the unique id for the Rally work item. Refer to the 'Create an External ID Custom Field in Bugzilla' section above. cf_rally_field
<CrosslinkUrlField> Bugzilla custom field (Free Text) containing text of a hyperlink to the corresponding artifact in Rally. cf_rally_url
<CopySelectors>
   <CopySelector>
Criteria to use when finding new Bugzilla issues to copy to Rally. Multiple criteria are ANDed together. An individual selector specification has the form:
<field><relation><value>,
where:
<field> is the name of a Bugzilla bug field
<relation> is one of =, !=, gt, lt, gte, lte
<value> is a valid value for the <field>.
<CopySelector>
status = Open
</CopySelector>
<CopySelector>
priority = Low
</CopySelector>
<UpdateSelectors>    <UpdateSelector> Criteria to use when finding existing Bugzilla issues to be updated in Rally. Multiple criteria are ANDed together. An individual selector specification has the form:
<field> <relation> <value>
where:
<field> is the name of a Bugzilla bug field
<relation> is either = or !=
<value> is a valid value for the <field>.
<UpdateSelector>
Release != alpha
</UpdateSelector>
</BugzillaConnection>

Specification of elements contained in the Connector section

<Connector>
Tag Name Description Sample Values
<FieldMapping>
Required
Determine what fields map between the two systems. See 'Field Mapping' section below.
<OtherFieldHandlers>
   <OtherEnumFieldHandler>
Allows a user to map non-alike drop-down values between the two systems. See 'Mapping Drop-Down Values' section below.
</Connector>

Specification of elements contained in the ConnectorRunner section

<ConnectorRunner>
Tag Name Description Sample Values
<Preview> Allows the user to enable a preview mode for testing where NO objects are copied/updated in either system. false or true
<Services>
Required
Determine what type of services to run. Be careful if you update in both directions because whichever system runs the update first will overwrite the updates of the other system. COPY_BUGZILLA_TO_RALLY, COPY_RALLY_TO_BUGZILLA, UPDATE_BUGZILLA_TO_RALLY, UPDATE_RALLY_TO_BUGZILLA
<LogLevel> Determines what type of messages are written to the log file. The highest level is 'Debug' where all messages are displayed. The default log level is 'Info'. Fatal, Error, Warn, Info, Debug
</ConnectorRunner>

Note: Incrementally set up the connector. Start with a basic configuration file, test that you can connect to Bugzilla and Rally in a "test" environment. Once you validate this is setup correctly, then start customizing the field mapping and field handler sections.

Field mapping

The field mapping section is located between the <Connector> tags in the configuration file and defines what fields map between the two systems.

For example, this definition sets up a mapping between the Rally field Name with the field Headline in the other system. On a create or update, the connector will only update the Name field in Rally and the Headline field in the other system.

<Connector>
   <FieldMapping>
     <Field><Rally>Name</Rally><Other>Headline</Other></Field>
   </FieldMapping>
</Connector>

When you set up your mapping between the two systems, ensure the fields are compatible between the two systems (an integer field should map to an integer field in the other system, a rich text should map to a rich text in the other system).

Otherwise, you might experience situations where information is not created/updated between the two systems and you will see an error in the log file. For example, the connector will post an error for a particular work item if you try to post a string to a custom field of type integer in Rally.

You can add subsequent mappings by appending to this list. For example, this sets up a mapping to Rally Name → Headline, Rally Description → Description, Rally Priority → Priority:


<Connector>
   <FieldMapping>
      <Field><Rally>Name</Rally><Other>Headline</Other></Field>
      <Field><Rally>Description</Rally><Other>Description</Other></Field>
      <Field><Rally>Priority</Rally><Other>Priority</Other></Field>
   </FieldMapping>
</Connector>

If you are mapping a drop-down value in Rally to the other system, this assumes that the drop-down values match. Otherwise, the connector will throw an error letting you know the value was not found in the list.

If your drop-down values are different between the two systems, see the next section Mapping Drop-Down Values.

caution_icon Mapping Bugzilla description field is not recommended
When you create a new bug in Bugzilla, there is a Description field available on the page, and some customers have naturally asked about mapping this field to the Description field in Rally defects. It turns out that this idea is not as straightforward to implement as it first appears.

Bugzilla maintains a collection of comments for each bug, and the Description field in the Create Bug page simply creates the first comment. So, whereas the Rally defect Description is fairly static - for example, containing steps to reproduce the problem - Bugzilla's comments are more of a dynamic activity stream, a conversation that takes place as the bug is being worked on. Given the differences in purpose for these two fields, we do not recommend trying to map them.

A better approach is to create a new custom field (such as "Summary") in Bugzilla that is used for the same purpose as Description in Rally. It's a simple matter to map those fields together.

Given the extensible nature of the Enterprise Integration Framework upon which the Bugzilla Connector is based, it is certainly possible to write additional code to provide some transfer of information between Rally Description and Bugzilla Comments. For example, one could write a field handler to concatenate the collection of Comments from a Bugzilla bug and put that concatenation in the Rally Description. Care would need to be taken when updating from Rally to Bugzilla, however, to compare the Rally Description with the concatenation of Bugzilla Comments and not create a new comment (containing the Rally Description, which is the whole comment history) each time the connector runs. Here again, mapping Rally Description to a custom Bugzilla field would be a better approach than creating new comments. Rally's Professional Services organization is available for this kind of custom development.

Field handlers

Mapping Drop-Down Values
Mapping Users
Mapping Project Fields, etc.

4.5 Run the connector

Once the bz_config.xml is setup, you can start running the connector. On Windows, if you installed the Rally for Bugzilla Connector using the RallyforBugzillaConnector-<version>.exe, you can simply double-click on the startbz.bat file which is customarily installed in C:\Program Files\RallyforBugzillaConnector\startbz.bat. This will start the connector in a DOS command window and open a text window in which the log messages from the connector will be written as the processing proceeds.

Alternatively on Windows, if Ruby was installed using the One-Click Ruby Installer at RubyInstaller.org, you can simply open a DOS shell and type:

to start the service. Double-click on WinTail.exe to run WinTail. In WinTail, open the file rallylog.log to watch the log messages generated by the connector. This is an easy way to confirm that the connector is working properly, or to discover any errors.

To stop the service, use Control-C in the command shell.

Multiple configuration files

For users who want to map to more than one workspace in Rally, need to map multiple artifact types or need to map to multiple containers (such as domain/projects in Quality Center or ClearQuest databases) in the other system, setting up multiple configuration files may make sense. Rally recommends naming the configuration files using descriptive names for easier troubleshooting.

To run multiple instances of the connector for different configuration files, pass in the list of config files as arguments to the rally2_bugzilla_connector.rb script or rally2_bugzilla_connector.exe.


ruby rally2_bugzilla_connector.rb config_workspaceA.xml config_workspaceB.xml
or
rally2_bugzilla_connector.exe config_workspaceA.xml config_workspaceB.xml

The connector will process the configuration files based on the command line argument order, and processes one file at at time.

Once it processes every configuration file, the connector will sleep based on the sleep value. The default is 15 minutes. To change the sleep value between runs, set this value (in minutes) as the last command line argument.


ruby rally2_bugzilla_connector.rb config_workspaceA.xml config_workspaceB.xml 10
or
rally2_bugzilla_connector.exe config_workspaceA.xml config_workspaceB.xml 10

*We recommend a sleep value of 10 minutes or more and advise against anything less.

5.1 Troubleshooting the connector

Once the connector is running, all errors are written to a log file in the directory where the rally2_bugzilla_connector.exe was invoked. Informational messages, warnings and errors are written to the log file depending on the value of the <LogLevel> tag in the <ConnectorRunner> section of the configuration file.

To see the most recent log messages on Windows, rename the file WinTail.dat to WinTail.exe and then double-click on the WinTail.exe and browse to the rallylog.log file.

Before the connector starts synchronizing objects between the two systems, it performs the following validations:

  1. Connecting to Rally is successful
  2. Connecting to the other system is successful
  3. Fields in the field mapping section exist in Rally and in the other system
  4. Each field handler has a corresponding field mapping section in the configuration file

To confirm the validation is successful without moving objects between the two systems, set the <Preview> tag in the configuration file to 'true'. This allows you to experiment with some different configuration options to debug an issue.

If you still cannot determine the root cause of an issue, then please email the entire log file and configuration file to Rally Support.

6.1 Tip

  • Mapping Rally Projects: If you are copying defects from Bugzilla to Rally using the RallyReferenceFieldHandler with Projects, you may see a "Could not find Rally Project with name ..." error in the log file if the connector user does not have Editor permissions to that project in Rally.

7.1 Known Issues

  1. Mapping Release/Iterations with Multiple Projects: If you are using a <RallyReferenceHandler> to map Releases/Iterations with the same name and multiple projects, you may receive an error if the Release/Iteration you are updating on the Defect references a different Project than the given Defect is assigned. The connector only returns the FIRST Release/Iteration with the matching name in Rally so it could have a reference to a Release/Iteration in a different project.
© 2012 Rally Software Development Corp | Legal