Skip to content

Commit

Permalink
Jira's autolink should support issue links that contain a comment lin…
Browse files Browse the repository at this point in the history
…k in the URL (mattermost#773)

* add autolink config for a comment that has a comment link at the end of the posted URL
  • Loading branch information
jupriano committed Aug 19, 2021
1 parent 7278600 commit c4fd985
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,16 @@ func (p *Plugin) AddAutolinks(key, baseURL string) error {
Pattern: `(` + strings.ReplaceAll(baseURL, ".", `\.`) + `/browse/)(` + key + `)(-)(?P<jira_id>\d+)`,
Template: `[` + key + `-${jira_id}](` + baseURL + `/browse/` + key + `-${jira_id})`,
},
{
DisableNonWordPrefix: false,
DisableNonWordSuffix: false,
Disabled: false,
Name: "jirajumptocomment",
Pattern: `(?P<IssueKey>[A-Za-z]+-[0-9]+)[?]focusedCommentId[^\\s]+`,
Scope: nil,
Template: `[${IssueKey} Link to comment]($0)`,
WordMatch: false,
},
}

client := autolinkclient.NewClientPlugin(p.API)
Expand Down

0 comments on commit c4fd985

Please sign in to comment.