title: Azure DevOps Pipelines Expressions
body: <p>Goal is to condition a task custom extension based on which task is used in pipeline. For that we want to use <a href="https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-pipeline-decorator?view=azure-devops" rel="nofollow noreferrer">pipelines decorators</a></p>
  <p>For example, if any user is using Powershell task in their pipelines, we want to execute our task with decorators.</p>
  <p>But we can figure out how to make it works.</p>
  <p>Yaml :</p>
  <pre><code> steps:
   - ${{ if and(eq(resources.repositories['self'].ref, r esources.repositories['self'].defaultBranch), not(containsValue(job.steps.*.task.id, 'd9bafed4-0b18-4f58-968d-86655b4d2ce9'))) }}:
     - script: dir
       displayName: 'Run my script (injected from decorator)'
  </code></pre>
  <p><em>Directly from Microsoft <a href="https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-pipeline-decorator?view=azure-devops#my-decoratoryml-final-version" rel="nofollow noreferrer">tutorial</a></em></p>
  <p>Inside Azure DevOps Pipelines, visual editor brings this error :</p>
  <pre><code> Unexpected property ${{ if containsValue(job.steps.*.task.id, '1c524b9b-9f4d-4897-8f1e-6ec33271d75c') }}
  </code></pre>
  <p>The first property must be task</p>
  <p>And at runtime :</p>
  <p><img src="https://i.stack.imgur.com/vpC1A.png" alt="error" /></p>
  <p>We also tried with <code>condition()</code> :</p>
  <pre><code>condition: |
      and
      (
        eq(dependencies.A.result, 'Succeeded'),
        containsValue(dependencies.A.steps.*.task.id, '1c524b9b-9f4d-4897-8f1e-6ec33271d75c')
      )  
  </code></pre>
  <p>But we can't find correct syntax, object content is null :</p>
  <p><img src="https://i.stack.imgur.com/61Rgb.png" alt="object_null" /></p>
  <p>Anyone know how to retrieve task id and use it to condition any further task ?</p>