Open pmacdougall opened 9 years ago
Thanks.
I do not know very much about Java. I wrote this plugin by watching other plugin(most of code is copy and paste). But I'll try to live up to your expectations. Please wait for few days.
@pmacdougall You mean that settings are set scope like below?
Actually, I'm not well understood... How about https://github.com/higanworks/rundeck-slack-incoming-webhook-plugin/commit/db73f7b676125b291a6e40064304cbdb22d9a68c ?
Sorry, I wasn't getting notifications about this for some reason.
I'm not sure about the code changes. I was expecting the webhook_url field to default to what was set in the framework.properties, that's all. If that's what this code change does, then great!
Ah, I had misunderstood. You mean that we can set default value of webhook_url by setting file. Is it correct?
@sawanoboly I have just configured this in the same way
in framework.properties, I have the following:
framework.plugin.Notification.SlackNotification.webhook_url=https://hooks.slack.com/services/morestuffhere
But when I go to a project and try to configure the notification as follows:
I've just build the 0.4 and set the framework.plugin.Notification.SlackNotification.webhook_url in framework.properties and it is working just fine.
I tried version 0.5 and ran into this issue too - I put the slack url into the framework properties, but when I went to enable notifications on a job I had to manually enter it into each job.
Going back to version 0.4 works - I just put the framework property in and then all I have to do for jobs is check the "slack notification" box and it works. I do get a blank line in the job config though that looks like it's trying to be an input field, but isn't:
The HTML:
<div class="row row-space">
<div class="col-sm-12">
<input type="hidden" name="notifyPlugin.onsuccess.type" value="SlackNotification" id="notifyPlugin.onsuccess.type">
<div>
<input type="hidden" name="notifyPlugin.onsuccess.enabled._SlackNotification"><input type="checkbox" name="notifyPlugin.onsuccess.enabled.SlackNotification" value="true" id="notifyPlugin.onsuccess.enabled.SlackNotification">
<label for="notifyPlugin.onsuccess.enabled.SlackNotification">Slack Incoming WebHook</label>
<span class="text-muted">Sends Rundeck Notifications to Slack</span>
</div>
<div id="notifholderPlugin2e5130cc" class="notificationplugin panel panel-default">
<div class="panel-body">
<div class="form-horizontal">
</div>
</div>
</div>
<script language="javascript">Event.observe(window,'load',function(z){Event.observe('notifyPlugin.onsuccess.enabled.SlackNotification','change',function(evt){var e31=evt.element();if($('notifyPlugin.onsuccess.enabled.SlackNotification').checked){$('notifholderPlugin2e5130cc').show();}else{$('notifholderPlugin2e5130cc').hide();}});if(Prototype.Browser.IE && $('notifyPlugin.onsuccess.enabled.SlackNotification').tagName.toLowerCase()=='input' && ($('notifyPlugin.onsuccess.enabled.SlackNotification').type.toLowerCase()=='radio'||$('notifyPlugin.onsuccess.enabled.SlackNotification').type.toLowerCase()=='checkbox')){Event.observe('notifyPlugin.onsuccess.enabled.SlackNotification','click',function(evt){var e31=evt.element();if($('notifyPlugin.onsuccess.enabled.SlackNotification').checked){$('notifholderPlugin2e5130cc').show();}else{$('notifholderPlugin2e5130cc').hide();}});}});</script>
</div>
</div>
First, thanks for this. I couldn't get the original plugin that you forked working at all.
Setting
framework.plugin.Notification.SlackNotification.webhook_url
inframework.properties
does not seem to work. Setting it on the job works perfectly and I'll continue to use that, but it's just a bit annoying having to go copy the url from somewhere else every time.When I look at the plugin in the plugin's section it shows
I set the url in the
framework.properties
, but the job notification section does not seem to pre-populate, which is what I expected.I didn't test project properties.