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 subscriptions active after channel archived. #571

Open
jfrerich opened this issue Jun 2, 2020 · 2 comments · May be fixed by #1122
Open

Jira subscriptions active after channel archived. #571

jfrerich opened this issue Jun 2, 2020 · 2 comments · May be fixed by #1122
Labels
Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Bug Something isn't working Up For Grabs Ready for help from the community. Removed when someone volunteers
Milestone

Comments

@jfrerich
Copy link
Contributor

jfrerich commented Jun 2, 2020

Summary

Anyone an idea for me how to remove a Jira subscription from an archived channel? It's not visible in the settings.

From Twitter https://twitter.com/cwaidner/status/1219730250030026753

Is the only way to unarchive the channel via the CLI, then remove subscription, then archive again?

Issue created from a message in Mattermost.

Original Jira Ticket

https://mattermost.atlassian.net/browse/MM-21955


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Plugin: Jira" community channel.

New contributors please see our Developer's Guide and our Plugins Guide.

@jfrerich jfrerich added Help Wanted Community help wanted Up For Grabs Ready for help from the community. Removed when someone volunteers Tech/Go Type/Bug Something isn't working labels Jun 2, 2020
@jfrerich jfrerich modified the milestones: v2.5, v2.6 Jun 2, 2020
@mustafayildirim
Copy link

Hi @jfrerich
I'm interested with this issue.
But I haven't decided the solution.
Should we stop sending message to archived channels? or Remove Jira Subscription when channels were archived?
And how is the plugin been notified when a channel is been archived?

@jfrerich
Copy link
Contributor Author

jfrerich commented Aug 6, 2020

Hi @mustafayildirim! I'm sorry to just now be getting back to you regarding this issue. There was some discussion on this idea in this [channel post](https://community.mattermost.com/core/pl/g4bojkmnepf1xqbtmfzfx6cfew

It seems the consensus is to disable subscriptions when a channel is archived. In this sense, you would just ignore sending notifications to subscribed channels, if they are archived.

You can check if a channel is archived by model.Channel.DeleteAt > 0

I would look at this function as a point of entry into the code. This function might be a little too aggressive, because the callers might actually want All channels, including archived.
https://github.com/mattermost/mattermost-plugin-jira/blob/master/server/subscribe.go#L172

The other location might be to just filter out channelIDs that are archived when parsing the webhook. This could be accomplished in the following code block.
https://github.com/mattermost/mattermost-plugin-jira/blob/master/server/webhook_worker.go#L67

I hope this helps and I hope you are still interested! If you have any further questions, please feel free to ping me here, or ask any Jira related questions in the Mattermost Plugin: Jira channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Bug Something isn't working Up For Grabs Ready for help from the community. Removed when someone volunteers
Projects
None yet
5 participants