In my Azure DevOps release pipeline I have a powershell script that sends a REST request to another application with the status 'failed' or 'successful'.
I want the status to send 'failed' if any of the previous jobs failed. So basically something like this:
if (($Agent -eq "Succeeded") -and ($LastJobsFailed -ne "true")) {
$change_status="successful"
}
else {
$change_status="failed"
}
Now I know that Azure Devops uses this status somewhere, since you can specify whether a job starts or not based on the results of the last jobs.
As a workaround I copied my script twice one time with status "successful" and this only runs when all jobs succeed and vice versa. But i'd like to do everything in one script :)
so I would expect it would be possible to find a list with all previous job statuses or something. Anyone any ideas?
thanks!