This topic explains how to integrate TestRail with Redmine. There are currently three ways to integrate TestRail with Redmine, namely:
- Using defect URLs to link test results to Redmine
- Using the defect plugin for Redmine to push and look up Redmine
- Using reference URLs to link test cases to Redmine
- Using the reference plugin for Redmine to look up Redmine issues in the References field of TestRail entities such as test cases, test runs, and milestones
You don’t have to use all the listed integration options, and you can mix and match the integration with other tools. Configuring the integration usually only takes a few minutes. This guide explains how to configure the integration and how it works.
The defect URLs are used to let TestRail know how to convert a Defect ID into a URL for your Redmine instance. There are two types of URLs: View URLs and Add URLs.
The Defect View URL is used to build a link to Redmine based on the Defect ID, so you can simply click on an ID to open the issue directly in Redmine.
The Defect Add URL is used to create a link to the issue creation screen inside Redmine. Once the URL is configured, a new Add link appears next to the Defects field in the Add Test Result dialog and the ‘Defects’ menu in TestRail’s Push Defect From Anywhere feature. This link allows you to jump to Rednine’s New Issue form to report a new bug.
If you use the ‘Add’ link, you can copy the ID of your new Redmine issue and enter it into any Defects or References field inside TestRail.
You can configure Rednine’s URLs in TestRail globally under Administration > Integration or on a per-project basis within any project’s settings. Use the following example URLs to configure the addresses:
Redmine installation Defect View Url: http://your-server/issues/%id% Defect Add Url: http://your-server/projects/<projectid>/issues/new
The reference URLs are implemented in a very similar manner to Defect URLs described above. The primary difference is Reference URLs are used for the ‘References’ field on various TestRail entities (instead of the Defects field).
The Reference View URL is configured in the same manner as described above and allows TestRail to create a direct link to a Redmine based on an ID entered into a References field.
The Reference Add URL is also configured in the same way as the Defect Add URL. Once configured, an ‘Add’ link will appear next to each References field in your instance or project. If you use the ‘Add’ link, you can copy the ID of your new Redmine issue and enter it into any Defects or References field inside TestRail.
If you have the Reference plugin configured, you’ll also be able to hover over a Reference ID to view the issue details directly from within TestRail. Keep reading to learn how to use and configure the Defect and Reference Plugins.
Defect plugins can be used to implement a deeper bug tracker integration and TestRail comes with a ready-to-use Redmine defect plugin.
To configure the defect plugin, select Administration > Integration and select Redmine in the Defect Plugin dropdown list. The next step is to configure all the necessary connection settings in the Configuration field. Project-specific plugins and configuration settings can optionally be specified under Administration > Projects.
When the defect plugin has been configured, a new Push link is shown next to the Defects field in the Add Test Result dialog. Clicking the link will open a popup dialog that enables you to push a bug report to Redmine without leaving TestRail. Once the test result was added, hovering the mouse cursor over an issue ID will open a window with useful information and status details about the issue in Redmine.
Please note: you first need to activate the REST API in Redmine under Administration > Settings > Authentication > Enable REST web service to use the defect plugin integration.
If you are using a Redmine version below 1.3, then you need to enable the defect plugin’s legacy mode and manually configure your project categories and trackers. The reason for this is that older Redmine versions didn’t have any API methods to retrieve a list of categories and trackers, so you would need to configure these details in TestRail once (or simply upgrade Redmine). To do this, enable the legacy mode by adding the legacy option to the connection section in the defect plugin configuration box (under Administration > Integration):
[connection] # ... mode=legacy
You will then need to add your trackers and project categories to the defect plugin configuration box as well, by adding the following sections:
; tracker_id=tracker_name [trackers] 1=Defect 2=Requirement 3=Support # (etc...) ; project_id.category_id=category_name [categories] 1.1=User Interface 1.2=Backend 1.3=Documentation
Make sure to use the exact same format as specified above. For categories, you would need to specify the project ID and the category ID as the key for each entry.
The Redmine defect plugin was built to work with a standard Redmine configuration. TestRail allows you to customize the fields which appear in the Push dialog as well as when hovering over Defect IDs. Preconfigured push fields and hover fields can be set to ‘on’ or ‘off’ in their respective [push.fields] and [hover.fields] sections, or change the order in which they appear by the fields in each section.
Please keep in mind some fields (such as the title field) are always enabled and may not appear in these sections due to always beings required by either TestRail or Redmine.
The Redmine Defect Plugin also supports modifying field properties as well as custom fields.
In addition to enabling, disabling, or re-organizing fields as described above, it’s also possible to change additional options per field. To do this, you would define a section for the field, such as [push.field.description], and specify additional options within this section.
[push.field.description] label=Detailed Description required=true
Please see below for a full list and explanation of the available field options:
|label||Specifies the display name of the field in the Push Defect dialogue (Required for custom fields)|
|size||Specifies whether the field is displayed as a compact field (compact) or uses the full width of the dialogue (full)|
|remember||Specifies if previously selected values for this field should be remembered and restored the next time the Push Defect dialogue is opened|
|required||Specifies if this field is mandatory or optional and whether users are required to enter a value for this field in the Push Defect dialogue|
|type||Specifies the type of this field, please see section Custom fields below for a list of supported field types (Required for custom fields)|
You can also use the above-mentioned approach to add custom fields to TestRail’s Push Defect dialogue. To do this, simply add a line with your custom field to the [push.fields] section to add a field. Custom fields are designated by customfield_<id>.
[push.fields] # ... description=on customfield_11002=on
Custom fields are designated by customfield_<id>. Then, add a [field.settings.customfield_<id>] section. This section is required so the plugin can push and/or retrieve data from your tool. The following is an example:
[field.settings.customfield_<field_name>] label=Customer size=compact type=dropdown required=true
The following field types are supported:
|dropdown||A dropdown list that allows users to select one of the multiple options|
|multiselect||Allows users to select multiple, pre-defined options|
|string||A small free-text field for up to 250 characters|
|text||A large free-text field without practical size limitations|
The Redmine Defect Plugin supports submitting attachments to Redmine as well. This field can be turned on and off, but cannot be customized. To submit one or more attachments to Redmine, simply drag the attachment to the attachments or description areas of the push dialog or click on the area to choose an attachment from your file system.
Reference plugins can be used to retrieve additional information from IDs entered into the References field of TestRail entities, such as test cases, test runs, and milestones. The Reference Plugin is configured on the References tab of the integration settings, in the same manner, the Defect Plugin is configured.
The plugin supports hovering over Reference IDs but does not support a Push dialog for the References field. It is also possible to customize the fields which appear via link hovering and add custom fields, as described above.
If you have the Defect Plugin already configured for Redmine, you can simply copy your [connection] and [hover.fields] sections from the Defect Plugin into the Reference plugin configuration. Alternatively, you can choose different fields to be displayed for References and Defects.
TestRail also supports custom defect plugins. If your team uses TestRail Server, it is possible to further customize the defect plugin (or build your own) to support additional field types or other data. Please see our Defect plugins documentation for additional information.