Why is IF failing with satl state file from Jenkins? I invoke a saltstack state file "init.sls" from a Jenkins pipeline as below. If job == Yes, it is expected to execute test_command and test_final, else if job == No, it must execute test2_command and test_final

{% if {{ job }} == 'Yes' %}
test_command:
  cmd.run:
    - name: echo "TEST COMMAND EXEC"
{% elif {{ job }} == 'No' %}
test2_command:
  cmd.run:
    - name: echo "TEST2 COMMAND EXEC"
{% endif %}

test_final:
  cmd.run:
    - name: echo "FINAL SUCCESS"


However it is not successful. Is there a better way to achieve using salt state execution?
The jinja syntax error is caused by the {{ around your job var.
Those curly braces are not required as you are already inside jinja block, noted by the {%.

So to get your code working just replace  your {{ job }} by job.
This should be working.