elastic / elastic/docs-content

[Internal]: Expand/clarify webhook action variable interpolation docs

Open
#3,751 1 comment 0 reactions 1 assignee Claimed by @nastasha-solomon View on GitHub
Team:Experience
Dominant language
No language data
Stars
47
Forks
261
Avg merge
3d 21h
Merged PRs (30d)
141

Description

### Description

[The existing webhook action documentation](https://www.elastic.co/guide/en/kibana/8.19/webhook-action-type.html#webhook-action-configuration) shows a trivial example of how to interpolate variables in the request body with Mustache (only showing strings), and mentions how strings are escaped. However in webhook HTTP requests customers might want to send entire JSON objects or arrays from the action execution context (i.e. generated alerts data) as part of the body, which requires using a slightly different approach compared to simple strings.

[In a recent SDH](https://github.com/elastic/sdh-kibana/issues/5838), a customer was confused by the docs, thinking they'd have to wrap the JSON object they wanted to interpolate in double quotes, as shown in the example. We might want to expand a bit the docs, showing how objects and arrays can be interpolated, or at least link the [rules documentation](https://www.elastic.co/guide/en/kibana/8.19/rule-action-variables.html#_rendering_objects_as_json) that explains a bit about these kind of variables. A link to Mustache's own documentation might help too.

cc @nastasha-solomon

### Resources

No new feature to learn, just the existing webhook action

### Which documentation set does this change impact?

Elastic On-Prem and Cloud (all)

### Feature differences

No diff

### What release is this request related to?

N/A

### Serverless release

Existing feature

### Collaboration model

The documentation team

### Point of contact.

**Main contact:** @umbopepato

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.