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

Option for posting completed issue updates only #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/views/settings/_slack_settings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<input type="checkbox" id="settings_post_updates" value="1" name="settings[post_updates]" <%= settings['post_updates'] == '1' ? 'checked="checked"' : '' %> />
</p>

<p>
<label for="settings_post_closed">Post Issue Closed?</label>
<input type="checkbox" id="settings_post_closed" value="1" name="settings[post_closed]" <%= settings['post_closed'] == '1' ? 'checked="checked"' : '' %> />
</p>


<p>
<label for="settings_post_wiki_updates">Post Wiki Updates?</label>
<input type="checkbox" id="settings_post_wiki_updates" value="1" name="settings[post_wiki_updates]" <%= settings['post_wiki_updates'] == '1' ? 'checked="checked"' : '' %> />
Expand Down
2 changes: 1 addition & 1 deletion lib/redmine_slack/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down