Extracting Quality Gate for new code via REST API?

Calling “/api/qualitygates” returns the current overall quality gates for maintainability (sqale_rating), security (security_rating) etc, This works well.

However there are two things I don’t understand nor can I find in any documentations

How to interpret the ‘periods’ list, e.g.
[{'index': 1, 'mode': 'previous_version', 'date': '2019-11-26T23:40:44+0100'}]
Question: How should ‘mode’ and ‘index’ fields used? (or is this just a static information about that particular quality gate, but in that case what does ‘mode’ signal?)

The endpoint returns the “Overall quality gate”. In the UI you can also see the metrics for new code.
Question: How can one get the QG metrics for new code for maintainability (sqale_rating) via the web_api?

You can get metrics (via /api/measures/component) for ‘new_security_rating’ and ‘new_reliability_rating’ but there is no field ‘new_sqale_rating’ (only ‘sqale_rating’)

1 Like