Integrating Redmine


#1

Hi,

I’m currently testing phabricator, mainly for Code Review, replacing our ReviewBoard.
But phabricator can do much more, so I’m trying to figure out how to integrate Redmine.

We cannot do a complete migration, because Redmine is also our help desk ticket system using some commercial extensions. But we could eventually migrate bugs/features and tasks.

Solution 1) just link redmine issue from phabricator. This already works based on the example P1209.
Cons: no automatic resolve of redmine issues when a phabricator issue marks as resolved.
The dev we need to enter two keywords, for redmine and phabricator which is inconvenient

Solution 2) import redmine issues into phabricator and use phabricator for development.
Redmine would only be used for support tickets, which can reference one or more bugs/features.

How to import existing redmine issues?

Any helps and hints are welcome :wink:


#2

If by “import” you mean a one-time import - https://secure.phabricator.com/T3179 has some info and scripts about importing from other systems (Not necessarily Redmine, but that shouldn’t be too bad.)

If you want deeper integration - https://secure.phabricator.com/T5462 has some options, ranging from “web hooks” to “Doorkeeper”, which isn’t totally supported, but provides a 2-way integration.


#3

This was my experience integrating a remote legacy system

I probably did this a totally terrible way…but…To keep continuous 2 way integration, I actually changed my Maniphest task to inherit from HarbormasterBuildableInterface

then added some build variables (+couple of other interface methods)

++ public function getBuildVariables() {
++ $results = array();
++
++ $results[‘maniphest.phid’] = $this->getPHID();
++ $results[‘maniphest.id’] = $this->getMonogram();
++
++ return $results;
++ }
++
++ public function getAvailableBuildVariables() {
++ return array(
++ ‘maniphest.phid’ => pht(‘The task phid identifier, if applicable.’),
++ ‘maniphest.id’ => pht(‘The task id identifier, if applicable.’),
++ );
++ }

This then lets any change in a maniphest task run a build plan

image

Which in turn can make an http request, passing across information about which tasks has changed to an external web service

That web service can then use conduit to pull the full task details via the task id or phid and update the remote ticket system with any changed data.

similar change notification triggers in the remote ticket system, update the maniphest task via conduit

The remote system, stores the maniphest taskid and maniphest stores the remote ticket number in a manifest-custom field

I use a maniphest query on those custom fields to ensure I don’t recreate duplicate tasks for the same remote system ticket number, but if it doesn’t exist I create the task in phabricator using conduit

updates are made by a bot user who is excluded from the heard trigger. (to prevent cyclic changes)

Such a system allows changes to be made in both Phabricator or in the remote system, with a near realtime update of both systems, with all the business logic about transformation of the data is in the webservice (which can be written in a language of your choice). There was a certain amount of username/status/state transformation of the data that occurs in the webservice.

This avoids the need for constant data polling to keep both system up to date and allows users to choose which system they prefer as their data entry. (as both will be updated automatically)

It also means legacy procedures and processes and other external systems still attached to the remote ticket system are not broken.

But the notification systems for phabricator are better than our legacy system so its easier to see and track changes


#4

very impressive, thx, but more than I need.
A one-time import of redmine projects and issues would be enough.

I didn’t find any ready to use redmine importer script,
so for now I’ll start to use phab for repos, review and hopefully will integrate our CI.

I’ll defer redmine import for now until I’m more experience with phab and just link redmine tickets from maniphest tasks when needed, keeping redmine as the main issue tracker.