Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jira's autolink should support issue links that contain a comment link in the URL #773

Open
mickmister opened this issue Jun 21, 2021 · 4 comments · May be fixed by #871
Open

Jira's autolink should support issue links that contain a comment link in the URL #773

mickmister opened this issue Jun 21, 2021 · 4 comments · May be fixed by #871
Labels
Difficulty/1:Easy Easy ticket Good First Issue Suitable for first-time contributors Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature Up For Grabs Ready for help from the community. Removed when someone volunteers
Milestone

Comments

@mickmister
Copy link
Contributor

Currently the autolink config used by this plugin converts issue links to shorthand links, but it does not work when the originally posted URL has a comment link at the end of the posted URL.

Here's an example provided by an admin that works with comments:

{
    "DisableNonWordPrefix": false,
    "DisableNonWordSuffix": false,
    "Disabled": false,
    "Name": "jirajumptocomment",
    "Pattern": "https://something.atlassian.net/browse/(?P\u003cIssueKey\u003e[A-Za-z]+-[0-9]+)[?]focusedCommentId[^\\s]+",
    "Scope": null,
    "Template": "[${IssueKey} Link to comment]($0)",
    "WordMatch": false
}

Discussed in https://community-daily.mattermost.com/private-core/pl/fkeoiwqbmbyrxrqnap877jykbo

@mickmister mickmister added Help Wanted Community help wanted Up For Grabs Ready for help from the community. Removed when someone volunteers Good First Issue Suitable for first-time contributors Tech/Go Difficulty/1:Easy Easy ticket Type/Enhancement New feature or improvement of existing feature labels Jun 21, 2021
@hanzei hanzei removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label Jun 30, 2021
@jupriano
Copy link

jupriano commented Aug 4, 2021

Hi @mickmister , I'd like to work on this. Can you help me on getting started?
and I think I can't open the link discussion.

@mickmister
Copy link
Contributor Author

@vicky-demansol There's really no helpful context in the linked conversation. Take a look at how Autolink is currently used in this project, and see how this can be added.

Normally we fetch all Jira projects, then create an Autolink entry for each project, but notice how the regex in the issue description does not contain the Jira project. The regex instead captures the project in the IssueKey submatch. This is especially useful because we then don't need to fetch the projects. This will also make it so we can support Autolinks for Jira Server instead of just Jira Cloud.

@mickmister
Copy link
Contributor Author

@vicky-demansol Completing this ticket would solve a lot of problems at once. If we apply the same logic of regex to regular issue links (along with comment links, i.e. what this ticket is requesting), it will properly solve #758 properly as well.

jupriano added a commit to jupriano/mattermost-plugin-jira that referenced this issue Aug 19, 2021
…k in the URL (mattermost#773)

* add autolink config for a comment that has a comment link at the end of the posted URL
jupriano added a commit to jupriano/mattermost-plugin-jira that referenced this issue Aug 19, 2021
…k in the URL (mattermost#773)

* change variable name from issue to watcher in server/client.go
* change variable type from bool to pointer bool in server/user.go
* add constants for error store new settings and error connect to Jira
* move CheckWatcherUser before PostNotifications (server/webhook_worker.go)
* remove LoadConnection after StoreConnection (server/settings.go)
jupriano added a commit to jupriano/mattermost-plugin-jira that referenced this issue Sep 2, 2021
…k in the URL (mattermost#773)

* bug fixing return on/off in fun settingsWatching
* fixing wording in settings.go
* change variable name from CheckWatcherUser to CheckIssueWatchers (webhook_worker.go)
* display logic of watching in ConnectionSettings
jupriano added a commit to jupriano/mattermost-plugin-jira that referenced this issue Sep 2, 2021
…k in the URL (mattermost#773)

* handling wh.notifications array is empty
* fixing shouldNotReceiveNotification condition
jupriano pushed a commit to jupriano/mattermost-plugin-jira that referenced this issue Nov 2, 2021
@hanzei hanzei added this to the v3.2.0 milestone Jan 4, 2022
@hanzei hanzei modified the milestones: v3.2.0, v3.3.0 Mar 1, 2022
@hanzei hanzei moved this to Submitted in Demansol Sprint Planning Mar 1, 2022
@mkdbns
Copy link

mkdbns commented Apr 28, 2023

This is complete our internal review and awaiting merge of depended PR 213

@avas27JTG avas27JTG modified the milestones: v4.1.0, next milestone Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment