Version: SonarQube 10.6.0
I have two user groups on SonarQube: heros, heros1.
Now I want to query only the heros group with an exact match to get the group-id for further API interaction.
According to documentation an exact match is possible.
The query http://localhost:9000/api/v2/authorizations/groups?q=heros returns both groups.
When I put heros under single or double quotation marks I get no result.
Also the regex pattern ^heros$ does not work.
Welcome to the community. The API doc mentions that searching by q param can either perform an exact match or a partial match (contains). So, in your case, this is performing a partial match.
I would suggest you iterate the result to match by group name and proceed.
That in my case it does a partial match was obvious.
But is there any possibility to do an exact match, as the documentation implies?
Of course I could filter the results, but that would be a dirty solution.
I am sorry for the confusion with the API documentation. It says, can either perform an exact match or a partial match (contains). Well actually, it can only perform a partial match. I will fix the documentation and have created this ticket.