# Is there a possibility to define an if/else condition within a JSON/webhook?

**URL:** https://community.zammad.org/t/is-there-a-possibility-to-define-an-if-else-condition-within-a-json-webhook/19832
**Category:** Technical assistance
**Created:** [March 17, 2026, 9:13am UTC](https://community.zammad.org/t/is-there-a-possibility-to-define-an-if-else-condition-within-a-json-webhook/19832 "2026-03-17T09:13:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MerlindCPohl](https://community.zammad.org/user_avatar/community.zammad.org/merlindcpohl/32/11653_2.png) [@MerlindCPohl](https://community.zammad.org/u/MerlindCPohl)
#### Post date: [March 17, 2026, 9:13am UTC](https://community.zammad.org/t/is-there-a-possibility-to-define-an-if-else-condition-within-a-json-webhook/19832/1 "2026-03-17T09:13:58Z")

</div>

- Used Zammad version: Zammad Version 7.0.0.71cc9d5f0f.saas
- Operating system: Mac OS
- Browser + version: Chrome

I was wondering if it is possible to define an if/else condiction within a JSON which I send via Webhook to my Slack channel.  
If the customer filled in the field “organization”, than it should be shown, so the staff knows already from the Slack message which company a customer is from.

I tried this:  
#{ticket.customer.fullname}#{if ticket.customer.organization} (#{ticket.customer.organization.name})#{end}

This unfortunately did not work, it is send the way it is written.  
Is there another way to define an if/else within a JSON?

Thanks a lot in advance!

---

<div class="post-metadata">

### Author: ![fliebe92](https://community.zammad.org/user_avatar/community.zammad.org/fliebe92/32/12102_2.png) [@fliebe92](https://community.zammad.org/u/fliebe92)
#### Post date: [March 17, 2026, 8:27pm UTC](https://community.zammad.org/t/is-there-a-possibility-to-define-an-if-else-condition-within-a-json-webhook/19832/2 "2026-03-17T20:27:21Z")

</div>

Hi @MerlindCPohl.

This is not possible, no. But what happens if you just use `#{ticket.customer.organization}` or `#{ticket.customer.organization.name}`? Is it replaced with `-` if there is no information? Maybe this is some kind of workaround for you.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [March 24, 2026, 8:27pm UTC](https://community.zammad.org/t/is-there-a-possibility-to-define-an-if-else-condition-within-a-json-webhook/19832/3 "2026-03-24T20:27:35Z")

</div>

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