Created
May 24, 2016 13:15
-
-
Save tomohiro/218f65a029a4d9a2634b3e609044da6f to your computer and use it in GitHub Desktop.
Redmine notifier to Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dotenv' | |
Dotenv.load | |
require 'slack-notifier' | |
require 'json' | |
require 'redmine-ruby' | |
module Redmine | |
class Issue < Base | |
collection_path 'issues.xml' | |
resource_path 'issues/:id.xml' | |
scope :recent_updated, -> { where(sort: 'updated_on:desc') } | |
end | |
end | |
notifier = Slack::Notifier.new ENV['SLACK_WEBHOOK_URL'] | |
redmine = Redmine::Client.new(ENV['REDMINE_URL'], ENV['REDMINE_TOKEN']) | |
notifier.ping redmine.issues.recent_updated.first.subject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment