How to get the issue keys which caused quality gate faliure

lets imagine we have a project which has 65 code smells and 2 new code smells and 1 bug.
According to the quality gate conditions, the quality gate is failing due to that 2 new code smells and 1 bug.
So is there any method or an API call which we can get issue keys of that 2 code smells and 1 bug ?
(Not all issue keys)

Hey there.

No single API will give you this – you’d need to construct the logic to filter GET api/issues/search based on the Quality Gate condition.

What are you trying to do with this data?

My manager need to see the authors who’s responsible for violating the quality gate condition. So I am going to take the issues keys which caused the quality gate failure. Already I have the data of all issue keys with the authors. Then I can map those 2 data and take the authors who’s responsible for quality gate violation

What edition of SonarQube are you using? We would recommend having your developers use something like Branch/Pull Request Analysis so that developer scan fix issues on their own before they ever fail the Quality Gate of your main branch.

As soon as our tool is used to “name and blame” individuals, users tend to stop wanting to use it entirely.