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

  • 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!

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.