Automation template syntax

I am still feeling my way around templating syntax, both in sensor configurations and in automations. My current issue is with the following automation:

This snippet of code works fine:

- id: '1605906216340'
  alias: 'set test max temp '
  description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.test_button
    to: 'on'
    from: 'off'
  condition: []
  action:
  - service: input_number.set_value
    data:
      value: 77
    entity_id: input_number.test_max_temp
  mode: single

while this does not:

- id: '1605906216340'
  alias: 'set test max temp '
  description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.test_button
    to: 'on'
    from: 'off'
  condition: []
  action:
  - service: input_number.set_value
    data:
      value_template: "{{ states('input_number.test_number')|int }}"
    entity_id: input_number.test_max_temp
  mode: single

At least this passes the config test, but it does not function.

If I remove the quote marks from the value_template, thinking that it is considering it all a string, then the config check fails.

What am I missing? TIA.

If I understand the release note correctly, then you don’t need the _template part anymore (since 0.115) for service calls: https://www.home-assistant.io/blog/#use-templates-directly-in-data-and-service-fields
So try using just value and your template:

- id: '1605906216340'
  alias: 'set test max temp '
  description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.test_button
    to: 'on'
    from: 'off'
  condition: []
  action:
  - service: input_number.set_value
    data:
      value: "{{ states('input_number.test_number') | int }}"
    entity_id: input_number.test_max_temp
  mode: single

Indeed, that works like a charm. Thanks muchly.