Api/deployments "FailureEncountered" is false for failing builds

Hello,

I am trying to build a solution to automatically test if Ocotpus deployments passed or failed. I have tested the GET deployments endpoint and am able to pull the most recent deployments, but my problem comes when trying to see if they passed or failed. The “FailureEncountered” value is not always true when a deployment fails, so I can’t use this method. My question is, am I using the “FailureEncountered” value incorrectly? Is there a different way to test deployments through the API? Or is this a possible bug?

Hi @benjamin.gordon,
I’d recommend grabbing the TaskId from the Deployments returned object and then using that to query the /tasks/{id} endpoint. This will return the State of the actual task that ran the deployment. This is basically what the UI does.

I agree the FailureEncountered results are confusing. I’m asking more internally to get a better answer there. I’ll update you when I know more on that.

Thanks,
Mark

1 Like

This worked great by the way, thanks so much Mark.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.