Open sam-mfb opened 2 months ago
On POST requests to the MS api for creating status policies, no validation is done for what you put in statusGenre
and statusName
. So if you have some other way of determining what those will be (including what they will be in the future once they start posting), you can add that to the policy at creation time and it will go through. That is, the policy will be created--but it won't pass until the status starts reporting.
In other words, you don't HAVE to check to recent statuses to see what's there, though that may be a nice convenience.
The typing for the Status policy type configuration (policy id "cbdc66da-9728-4af8-aada-9a5a32e4a226") is (sorry, in Typescript):
Their appear to be some status's that switch the semantic meaning of statusGenre and statusName (e.g., the codecoverage status seems to always put
codecoverage
in the name and the project name as thegenre
)It is possible to query a list of recent status checks of type
By using the undocumented endpoint
https://dev.azure.com/[YOUR_ORG]/_apis/Contribution/HierarchyQuery?api-version==5.0-preview.1
with a POST body as follows:This will return the following object:
The
recentStatus
object is what you want...