webhook
webhook copied to clipboard
Reference to any array element with match
Hello. I'm trying to set up a webhook match rule for referencing to a nested value in the JSON payload. This is an example JSON:
{ "commits": [ {"title": "Test"}, {"title": "Merge"} ] }
And here's part of my trigger-rule:
- match:
type: regex
regex: ^Merge
parameter:
source: payload
name: commits..title
The thing is there may be an uncertain number of commits in JSON and I need to match any of it. This is why I can't refer to specific JSON values. I was trying to set values like name: commits.title
, name: commits..title
or name: commits.[].title
, but it doesn't work. The error from the log file: "parameter node not found". Is it a bug or a feature? Is there any way to match any nested value?
Unfortunately, this is not currently possible. References to array elements must be explicit.
So let's turn this into an enhancement request.