From a90cd81f991028a9bf3808e559d56947d4b859ef Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Fri, 10 Nov 2017 10:06:47 +0100 Subject: [PATCH] Docs: Fix broken watcher example using multi line strings Original commit: elastic/x-pack-elasticsearch@7398be67c4bf937a303ba43f3e19538712e94b66 --- docs/en/watcher/actions/webhook.asciidoc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/en/watcher/actions/webhook.asciidoc b/docs/en/watcher/actions/webhook.asciidoc index 79aa9165988..676dfb2a0e6 100644 --- a/docs/en/watcher/actions/webhook.asciidoc +++ b/docs/en/watcher/actions/webhook.asciidoc @@ -48,15 +48,13 @@ For example, the following `webhook` action creates a new issue in GitHub: -------------------------------------------------- "actions" : { "create_github_issue" : { + "transform": { + "script": "return ['title':'Found errors in \\'contact.html\\'', 'body' : 'Found ' + ctx.payload.hits.total + ' errors in the last 5 minutes', 'assignee' : 'web-admin', 'labels' : ['bug','sev2']]" + }, "webhook" : { "method" : "POST", "url" : "https://api.github.com/repos///issues", - "body" : "{ - \"title\": \"Found errors in 'contact.html'\", - \"body\": \"Found {{ctx.payload.hits.total}} errors in the last 5 minutes\", - \"assignee\": \"web-admin\", - \"labels\": [ \"bug\", \"sev2\" ] - }", + "body": "{{#toJson}}ctx.payload{{/toJson}}", "auth" : { "basic" : { "username" : "", <1>