'Update TotalFailed count and PercentComplete status on AzureDevOps Release stage

After running a test, the view on AzureDevOps Release stage looks like this:

enter image description here

Say for displaying status of non-test related deployment, how do I add these details "percent complete of 65%" and "total failed of X82" on a specific deployment/stage view in Release pipeline instance?

PS, I tried fetching https://docs.microsoft.com/en-us/rest/api/azure/devops/release/releases/get-release?view=azure-devops-rest-6.0 but couldn't find how it's done on this existing failed release.

PS, at the moment, I'm using Release, not YAML Azure pipeline.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source