title: Azure DevOps Release Pipeline - Run a task when a specific previous task failed
body: <p>I am using <strong>classic editor release pipeline</strong> and the requirement is to run a 'send email' task when a specific task fails. How can we configure <strong>custom condition</strong> for this requirement?</p>
  <p>When we use the Azure provided condition 'Only when a previous task has failed', the task is getting executed if any of the previous task has failed. Hence, requirement is not met. ie if there are three tasks A,B,C and the <strong>requirement is to trigger C only when B fails</strong>, using 'Only when a previous task has failed' as condition will trigger C even when A fails.</p>
  <p>Please help with the steps to configure custom condition for this requirement.</p>
  <p><a href="https://i.stack.imgur.com/I8PkY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I8PkY.png" alt="enter image description here" /></a></p>