Skip to content

Commit

Permalink
fix: jira issue urls being wrong sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Mar 20, 2018
1 parent f4b0899 commit 67fb8bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app-src/scripts/main/global-services/jira-s.js
Expand Up @@ -188,6 +188,15 @@
});
}

_makeIssueLink(issueKey) {
let fullLink = this.$rootScope.r.jiraSettings.host + '/browse/' + issueKey;
const matchProtocolRegEx = /(^[^:]+):\/\//;
if (!fullLink.match(matchProtocolRegEx)) {
fullLink = 'https://' + fullLink;
}
return fullLink;
}

mapIssue(issue) {
return {
title: issue.key + ' ' + issue.fields.summary,
Expand All @@ -200,7 +209,7 @@
originalUpdated: issue.fields.updated,
originalStatus: issue.fields.status,
originalAttachment: Jira.mapAttachments(issue),
originalLink: 'https://' + this.$rootScope.r.jiraSettings.host + '/browse/' + issue.key,
originalLink: this._makeIssueLink(issue.key),
originalEstimate: issue.fields.timeestimate && moment.duration({
seconds: issue.fields.timeestimate
}),
Expand Down

0 comments on commit 67fb8bf

Please sign in to comment.