From a59bcef0cae0e8490e20280eb67f1d9c1fa6df48 Mon Sep 17 00:00:00 2001 From: Ben Fitzhardinge Date: Thu, 23 Jun 2016 11:22:17 +1000 Subject: [PATCH] Option for posting completed issue updates only Signed-off-by: Ben Fitzhardinge --- app/views/settings/_slack_settings.html.erb | 6 ++++++ lib/redmine_slack/listener.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/settings/_slack_settings.html.erb b/app/views/settings/_slack_settings.html.erb index ae281b9..d07a49d 100644 --- a/app/views/settings/_slack_settings.html.erb +++ b/app/views/settings/_slack_settings.html.erb @@ -40,6 +40,12 @@ />

+

+ + /> +

+ +

/> diff --git a/lib/redmine_slack/listener.rb b/lib/redmine_slack/listener.rb index 2e6c994..f46dbaf 100644 --- a/lib/redmine_slack/listener.rb +++ b/lib/redmine_slack/listener.rb @@ -44,7 +44,7 @@ def controller_issues_edit_after_save(context={}) channel = channel_for_project issue.project url = url_for_project issue.project - return unless channel and url and Setting.plugin_redmine_slack[:post_updates] == '1' + return unless channel and url and (Setting.plugin_redmine_slack[:post_updates] == '1' or ( Setting.plugin_redmine_slack[:post_closed] == '1' and issue.status.is_closed ) ) return if issue.is_private? msg = "[#{escape issue.project}] #{escape journal.user.to_s} updated <#{object_url issue}|#{escape issue}>#{mentions journal.notes}"