opendistro-for-elasticsearch/alerting-kibana-plugin

Painless problem

Opened this issue · 0 comments

Hello,

I've this trigger below , and i'd like to have only the user.name display on a MS teams card, not the whole jason results ! It seems is it possible with an array, but how the array can be printed in the results ??

Thx for your help.

if (ctx.results[0].hits.total.value > 1) {
def l = new ArrayList();

for(int i=0; i< ctx.results[0].hits.hits.length;i++){
    l.add(ctx.results[0].hits.hits[i]._source.user.name)
}
Collections.sort(l);
return true;

}