Sonarqube find how long quality gate status was in failed state

version: SonarQube 6.7
What are we trying to achieve: We need to understand how long a project was in a Quality Gate = “failed”.
What we have tried so far: We are trying to find these deatils using the REST API and could not find any that can help us.

Best,
-Eshwar.

Hey there.

GET api/measures/search_history should be helpful (with the metric alert_status) or GET api/project_analyses/search. Documentation for both these Web APIs are available in the Web API documentation.

And, you are running an EOL version of SonarQube. You should upgrade to at least the minimum supported version, v7.9 LTS

@Colin Thank you for the help. I don’t see the alert_status on 6.7 version. when did this get introduced? 2nd, I was able to find the details using the endpoint api/project_analyses/search. It does give the details per snapshot and comapred value with its previous snapshot. However, it comes in the property - “name”, thus making me do a substring matching. Is there any other direct route to accessing it as a prop itself? like - I see that api/ce gives us a prop for the latest activity as either “success” or “failed” or “canceled”.

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