Integration with Redmine
Integration with Redmine allows comments to be automatically added to tasks mentioned in commits or merge requests. In addition, the integration can automatically change the status of mentioned tasks.
Creating an integration with Redmine
To create an integration, go to the project settings, open the Integrations section, and click the Create button next to the Redmine integration.
Establishing a connection
To connect to Redmine, fill in the following fields:
- Web page URL — the address of the Redmine server. For example,
https://redmine.example.com. - Redmine API token — the token of the user on whose behalf GitFlic will send requests to Redmine.
To check the established connection, use the corresponding button in the integration settings form.
Triggers
In this section, select the events after which the integration should be triggered:
- When working with commits;
- When working with merge requests.
A Redmine task can be mentioned:
- in a commit message;
- in a merge request title;
- in a merge request description.
The following actions are available:
- Enable comments. The integration will automatically add a comment to the Redmine task with information about the event in which the task was mentioned. Standard and extended variants are available for selecting the comment content.
- Change task status. The integration will automatically move the mentioned task to the selected status when the corresponding action is detected in the text of a commit or merge request.
- Target status ID. The numeric identifier of the Redmine status to which the task must be moved.
When status changes are enabled, the target status ID must be explicitly specified. The integration does not select the final task status automatically.
To change the task status, specify the action and task number in the event text. For example:
Закрывает GF-123
or for standard Redmine numbering:
Закрывает №123
To change the status of multiple tasks, specify each task separately:
Закрывает №123
Закрывает №124
Matching tasks in Redmine
To determine the tasks whose mention should trigger the integration, the following settings are used:
- Regular expression for tasks in Redmine. An optional field that allows configuring expressions which, when detected, should cause the integration to change the task status. For example:
Закрывает,Исправляет,Решает,Closes,Fixes, orResolves. - Prefix for tasks in Redmine. A required field that defines the task number format.
If Redmine uses identifiers with a prefix, specify the prefix in the PREFIX# format.
For example, the value:
GF#
allows the following mentions to be recognized:
GF-123
GF123
Standard Redmine task numbering
In the standard Redmine configuration, tasks have consecutive numeric identifiers without a letter prefix: 1, 2, 3, and so on.
In this case, in the Prefix for tasks in Redmine field, specify the symbol:
#
At the same time, in commit messages, titles, and descriptions of merge requests, the special number symbol № must be used before the task number.
For example:
Реализована выгрузка отчёта, задача №4
In this case, the integration recognizes the mention and sends a request to the Redmine task with the identifier 4.
To change the task status, the following text can be used:
Закрыл задачу №4
or:
Закрывает №4
Important: when using standard consecutive identifiers, the
№symbol before the task number is required.
The following variants will not be recognized as a task mention:
Исправлена задача 4
Исправлена задача #4
Correct variant:
Исправлена задача №4
The # symbol specified in the integration settings indicates the mode for working with standard numeric Redmine identifiers. In commit and merge request texts, the № symbol must be used instead of it.
Integration operation example
Suppose there is a task with the identifier 4 in Redmine, and the following are specified in the integration settings:
Префикс для задач в Redmine: #
ID целевого статуса: 3
A user creates a commit with the message:
Исправлена ошибка при сохранении профиля, задача №4
If comments are enabled, the integration will add a comment with information about the commit to task 4.
To additionally move the task to the status with ID 4, the action must be specified:
Исправлена ошибка при сохранении профиля
Закрывает №4
After processing the event, GitFlic will find the Redmine task with the identifier 4, add a comment, and send a request to change its status.
Automated translation!
This page has been automatically translated. The text may contain inaccuracies.