# Add custom field for action to teams webhook

**URL:** <https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779>\
**Category:** Elastic Security\
**Created:** [May 31, 2023, 9:49am UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779 "2023-05-31T09:49:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fontexD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fontexd/32/117095_2.png) [@fontexD](https://discuss.elastic.co/u/fontexD)\
**Post date:** [May 31, 2023, 9:49am UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779/1 "2023-05-31T09:49:58Z")

</div>

im trying to add a custom field from the table of the event but it dosent pass the value into the teams webhook

 ![help](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e28855e587cd4a518edfbd9e6cd70abb352730ac.png)

---

<div class="post-metadata">

**Author:** ![vitaliidm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vitaliidm/32/101610_2.png) [@vitaliidm](https://discuss.elastic.co/u/vitaliidm)\
**Post date:** [June 2, 2023, 6:46pm UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779/2 "2023-06-02T18:46:17Z")

</div>

Hi @fontexD  
Which version of ES/Kibana are you using?

Before 8.8, action has in its context array of alerts. So, to get property from alert, you would need to do something like this:

1. Get property from the first only alert

> {{#context.alerts.0}}{{custom.property}}{{/context.alerts.0}}

1. Get all properties from array

> {{#context.alerts}}{{custom.property}}{{/context.alerts}}

Thanks, Vitalii

---

<div class="post-metadata">

**Author:** ![fontexD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fontexd/32/117095_2.png) [@fontexD](https://discuss.elastic.co/u/fontexD)\
**Post date:** [June 6, 2023, 12:42pm UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779/3 "2023-06-06T12:42:10Z")

</div>

how would i get this one ? im using 8.8 :=)

 ![thisone](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6465a7274810f5b9340f95954fb749379cd7726.png)

i tried all of this

```auto
{
"alert_id": "{{alert.id}}",
"alert_action_group": "{{alert.actionGroup}}",
"alert_action_subgroup": "{{alert.actionSubgroup}}",
"alert_action_group_name": "{{alert.actionGroupName}}",
"kibana_base_url": "{{kibanaBaseUrl}}",
"rule_id": "{{rule.id}}",
"rule_name": "{{rule.name}}",
"rule_description": "{{rule.description}}",
"user": "{{user.target.name}}",
"user": "{{winlog.event_data.TargetUserName}}"

```

---

<div class="post-metadata">

**Author:** ![fontexD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fontexd/32/117095_2.png) [@fontexD](https://discuss.elastic.co/u/fontexD)\
**Post date:** [June 6, 2023, 12:58pm UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779/4 "2023-06-06T12:58:02Z")

</div>

> [@vitaliidm](#):
>
> {{#context.alerts}}{{custom.property}}{{/context.alerts}}

IT WORKED! thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 4, 2023, 12:58pm UTC](https://discuss.elastic.co/t/add-custom-field-for-action-to-teams-webhook/334779/5 "2023-07-04T12:58:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
