Creating gating criteria for Fortify VSTS task based on the scan results


Fortify SCA has been integrated with VSTS build to perform automated scans. Now we would like to create gating criteria for the build task to make pass or fail based on the scan results. Is there a way to find the results (no. of critical/high defects) from the scan FPR file? I know SSC provides API, but not sure how I can implement the same for this purpose.