Defect #36365

centos8 配置redmine后,添加钉钉的自定义webhook,不能推送项目的变化信息到钉钉群

Added by wu yunyun 5 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Hook requests
Target version:-
Resolution: Affected version:4.1.0

Description

1、钉钉群已配置安全网段IP和安全设置,并将WEBHOOK添加到 webhook_listener.rb,然后重启了redmine
还是不能推送通知
webhook_listener Post的代码:
def post(webhooks, request_body)
Thread.start do
webhooks.each do |webhook|
begin
Faraday.post do |req|
req.url webhook.url
req.headers['Content-Type'] = 'application/json'
req.body ={
"msgtype"=>" text",
"text"=> {
"content"=> "#{request_body}"
}.to.json

}
end
rescue => e
Rails.logger.error e
end
end
end
end
end
end

Also available in: Atom PDF