Skip to content
Discussion options

You must be logged in to vote

You can make the mentions field optional by using Mustache-like conditional templating. Replace your mentions line with:

mentions: '{{#alert.mentions}}{{.}}{{/alert.mentions}}{{^alert.mentions}}[]{{/alert.mentions}}'

This tells the workflow engine: if alert.mentions exists, use it; if not, use an empty array. This approach leverages the IOHandler's support for conditional logic and default values in templates, so missing mentions won't cause failures anymore see code reference.

No built-in YAML syntax exists for this, but this template pattern is supported by the engine's rendering logic see IOHandler implementation.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shahargl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant