{% set ns = namespace(bool=false) %}
{% for val in my_test_json.list1 %}
{% if val in my_test_json.list2 %}
{% set ns.bool = true %}
{% endif %}
{% endfor %}
{{ ns.bool }}
This works only if there are no duplicate values within a list. For example, list1 cannot have more than one instance of a2. If it does then the suggested template will produce an incorrect result. If there’s a possibility that either list can contain duplicates within it then use the example Hellis81 provided.