mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Change message for text so webhook works on slack (#2838)
* Change message for text so webhook works on slack * Update preview text for the webhook in the FE
This commit is contained in:
parent
bb187a7885
commit
d0777ccfd3
1
changes/issue-2434-change-webhook
Normal file
1
changes/issue-2434-change-webhook
Normal file
@ -0,0 +1 @@
|
||||
* Update key text for webhook from message to text to support Slack out of the box
|
@ -250,7 +250,7 @@ class AppConfigForm extends Component {
|
||||
}
|
||||
|
||||
const json = {
|
||||
message:
|
||||
text:
|
||||
"More than X% of your hosts have not checked into Fleet for more than Y days. You’ve been sent this message because the Host status webhook is enabled in your Fleet instance.",
|
||||
data: {
|
||||
unseen_hosts: 1,
|
||||
|
@ -38,7 +38,7 @@ func TriggerHostStatusWebhook(
|
||||
percentUnseen, appConfig.WebhookSettings.HostStatusWebhook.DaysCount,
|
||||
)
|
||||
payload := map[string]interface{}{
|
||||
"message": message,
|
||||
"text": message,
|
||||
"data": map[string]interface{}{
|
||||
"unseen_hosts": unseen,
|
||||
"total_hosts": total,
|
||||
|
@ -45,7 +45,7 @@ func TestTriggerHostStatusWebhook(t *testing.T) {
|
||||
require.NoError(t, TriggerHostStatusWebhook(context.Background(), ds, kitlog.NewNopLogger(), ac))
|
||||
assert.Equal(
|
||||
t,
|
||||
`{"data":{"days_unseen":2,"total_hosts":10,"unseen_hosts":6},"message":"More than 60.00% of your hosts have not checked into Fleet for more than 2 days. You’ve been sent this message because the Host status webhook is enabled in your Fleet instance."}`,
|
||||
`{"data":{"days_unseen":2,"total_hosts":10,"unseen_hosts":6},"text":"More than 60.00% of your hosts have not checked into Fleet for more than 2 days. You’ve been sent this message because the Host status webhook is enabled in your Fleet instance."}`,
|
||||
requestBody,
|
||||
)
|
||||
requestBody = ""
|
||||
|
Loading…
Reference in New Issue
Block a user