Moving from payload_templates to payload breaks expression

Hi, can’t seem to get this right. This works

tap_action:
  action: call-service
  service: mqtt.publish
  data:
    topic: command/set/audio
    payload_template: |-
      { "area": "living", "action": "mute",
        "state": {% if is_state("input_boolean.living_mute", "on") %} true {% else %} false {% endif %}
      } 
    retain: false
  target: {}

but using payload_templates breaks it. The expression doesn’t get evaluated and is sent as an entire string. Trying to migrate away from payload_template as it is being deprecated.

Thanks for your help in advance.

You cant template anything in tap actions in the UI. Not sure how this ever worked for you. You have to put this in a script.