Skip to content

Commit

Permalink
Notifications work with Redmine Agile plugin (sciyoshi#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Teguh Dwicaksana committed Feb 25, 2019
1 parent 1340d83 commit f9fb15c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/redmine_slack/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ def redmine_slack_issues_edit_after_save(context={})
speak msg, channel, attachment, url
end

def controller_agile_boards_update_after_save(context={})
issue = context[:issue]
journal = issue.journals.last

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 if issue.is_private?

msg = "[#{escape issue.project}] #{escape journal.user.to_s} updated <#{object_url issue}|#{escape issue}>#{mentions journal.notes}"

attachment = {}
attachment[:text] = escape journal.notes if journal.notes
attachment[:fields] = journal.details.map { |d| detail_to_field d }

speak msg, channel, attachment, url
end

def model_changeset_scan_commit_for_issue_ids_pre_issue_update(context={})
issue = context[:issue]
journal = issue.current_journal
Expand Down

0 comments on commit f9fb15c

Please sign in to comment.