Excluding a tag from a search

Hi,
is there a way to search for projects that do not have a tag.

I only found ways (in the ui and the api) for searching projects that have a given tag.

Hi,

Sorry, but this simply isn’t available.

 
Ann

Ok,
would be a nice feature either in the UI or the api.

If you search for projects that have no tags at all, I found this way:
curl -s -X GET -u $SONARQUBE_ACCESS_TOKEN: "$SONARQUBE_URL/api/components/search_projects?ps=500" | jq '.components[] | select(.tags | length > 0 | not ) | .key'
Something similar could be used for filtering projects that do not have a given tag.

Hi,

I’ve moved this to the New Features category.

 
Ann

1 Like

Hi,

Can you please help me understand the reason why you’d like to search for projects which don’t have a specific tag?

Hi,

in our SonarQube instance we manage around 500 projects and add tags to them based groups they are part of.
Our main use case is to find the projects that have no tags at all, which usually means that their setup is not completed in SonarQube.
The other use case is that there are around 25 main groups which again contain multiple subgroups. When we want to have a view on a subset of these groups, it would be convenient to be able to exclude 4-5 instead of having to select the 20 other ones we want to keep.

Hope this gives you an idea of how we use the tags and what we wanted to achieve.

Thanks