Page MenuHomePhabricator

"JIRA issues" integration problems when JIRA is NOT configured on the root of domain
Closed, ResolvedPublic

Description

When JIRA is not configured on the root of domain, links generated in Differential are invalid.

For example if JIRA is installed on "www.example.com/jira/", issue "J-1" points to "www.example.com/browse/J-1" instead of "www.example.com/jira/browse/J-1".

Event Timeline

salehe raised the priority of this task from to Needs Triage.
salehe updated the task description. (Show Details)
salehe added a project: Differential.
salehe added a subscriber: salehe.

This is an issue in DoorkeeperBridgeJIRA::fillObjectFromData(), where we write over the entire path:

// Convert the "self" URI, which points at the REST endpoint, into a
// browse URI.
$self = idx($result, 'self');
$uri = new PhutilURI($self);
$uri->setPath('browse/'.$obj->getObjectID());

Instead, the logic should look something like this, I guess (offhand, I don't see a better approach to determining the human-readable URI):

  • Find rest/,
  • drop the string starting from there, instead of the entire path,
  • append browse/<id>.

Really testing this properly involves a lot of mucking with JIRA to reproduce the environment though. @salehe, would you be willing to help test a patch?

epriestley triaged this task as Normal priority.
epriestley added a project: Doorkeeper.

Yes. I've tested the patch and it worked fine(I had to manually delete previously generated links from database but it worked afterwards).

Thanks!

Although, I think some changes should be applied to DoorkeeperRemarkupRuleJIRA too. @epriestley