Alerting: Trigger message not showing array length

Hi, working on Open Distro Kibana 1.6.0 with the Alerting module, I am trying to include the length of an array into the trigger message with the following code:

{{#ctx.results}}{{aggregations.buck_componentName.buckets.length}}{{/ctx.results}}

In the “message preview” window of the Alerting plugin the correct value is shown, but it is missing in the messages sent. Where I am going wrong?

TNX in advance - Gunnar