0

enter image description hereBasically I want two tasks, I want the second task (Task B) to look at the status of first task (Task A).

All the examples I see use yaml, within the Release section of setting up deployments, they all use a user interface.

If I use Agent.JobStatus in Step A or Step B, it shows the Job Status of what we are currently in. I figure I need to capture the value between Task A and Task B (not within either one), how does one capture that? I either can't find it, or not understanding something.

I have put it in the agent job variable expression of Task B....hoping it gathered what was the last job status, but it is null.

in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')

Greg P
  • 772
  • 2
  • 10
  • 23
  • 2 tasks or 2 staged? – Shayki Abramczyk Jun 16 '21 at 13:44
  • 2 tasks within the same stage. Basically we have a 'default' test that just says passed/failed...if it fails, we want to kick off a more detailed testing, which does screen recording. Figured basically why take up the resources unless there is failures. Since some/most VS test pass, it says SucceededWithIssues...so the setting to 'only if previous job fails'..doesn't work. Added image to main question.. – Greg P Jun 16 '21 at 14:28
  • According to this one https://developercommunity.visualstudio.com/t/release-pipeline-variablesagentjobstatus-returns-n/394992 you can't use Agent.JobStatus to do that. Theoretically, you can use REST API to get status of any job in current run. You will assign that info to pipeline variable and then you will use that variable in job condition. – jdfa Jun 18 '21 at 22:19

0 Answers0