This plugin automatically links related issues in Redmine when internal issue links (e.g., #123
) are mentioned in comments.
-
Clone this repository into your Redmine
plugins
directory:git clone http://github.com/INSANEWORKS/redmine_auto_link_relate.git plugins/redmine_auto_link_relate
-
Install dependencies:
bundle install
-
Restart your Redmine instance.
-
Verify that the plugin is installed under Administration > Plugins.
When a user adds a comment containing an internal issue link (e.g., #123
), this plugin automatically creates a relation between the current issue and the linked issue.
You can use the provided Rake task to scan all existing comments and link issues retroactively.
Warning: This task may modify your database in unexpected ways. Always back up your data before running it.
-
Create a backup of your database:
pg_dump redmine > redmine_backup.sql # For PostgreSQL mysqldump redmine > redmine_backup.sql # For MySQL
-
Run the task:
bundle exec rake redmine_auto_link_relate:relate_issues RAILS_ENV=production
-
Monitor the output:
- Existing relations and invalid operations are skipped.
- Details of newly created relations are logged to the console.
- Scans all comments in your Redmine instance.
- Extracts internal issue links (e.g.,
#123
) from the comments. - Creates relations between issues where appropriate.
The Rake task skips creating relations in the following cases:
- The relation already exists.
- The relation would cause a circular dependency.
- The issues are in a parent-child relationship.
- Other relationships (e.g.,
duplicates
,blocks
,precedes
) already exist between the issues.
To contribute:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your changes.
This plugin is licensed under the MIT License. See LICENSE for details.