title: Azure DevOps Conditional execution of Job that depends on a Job in another Stage
body: <p>I have a <code>pipeline.yaml</code> that looks like this </p>
  
  <pre><code>pool:
    vmImage: image
  
  stages:
    -stage: A
     jobs: 
       -job: a
        steps: 
       - script: |
            echo "This is stage build"
            echo "##vso[task.setvariable variable=doThing;isOutput=true]Yes"
          name: BuildStageRun
    -stage: B
     jobs:
        -job: b
         steps: #do something in steps
  
        -job: c
         dependsOn: a
         condition: eq(dependencies.build.outputs['BuildStageRun.doThing'], 'Yes')
         steps:
          - script: echo "I am scripting" 
  </code></pre>
  
  <p>So, there are 2 stages, <strong>A</strong> with one job <strong>a</strong>, and <strong>B</strong> with 2 jobs <strong>b</strong> and <strong>c</strong>. I would like to have job <strong>c</strong> executed only when job <strong>a</strong> has executed. I tried to do so by setting the variable <em>doThing</em> in job <strong>a</strong> to Yes and then check this variable in job <strong>c</strong>. </p>
  
  <p>But I get an error:</p>
  
  <blockquote>
    <p>Stage plan job <strong>c</strong> depends on unknown job <strong>a</strong>.</p>
  </blockquote>
  
  <p>The varible definition and the definition of condition was taken from <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&amp;tabs=yaml" rel="nofollow noreferrer">Azure documentation</a></p>
  
  <p>Do you have any suggestion on how to get this working? </p>