Not sure if this is the correct category, as I don’t know if this is a “need PM for a day” topic.
What I’m trying to do:
I’m trying to generate a custom report using a couple of the readily available APIs in version 1 and version 2 of SonarQube Data Center Edition. The report most closely resembles what I see in the Administration → Background Tasks UI , which gives me a view of the successful project analysis tasks. Instead of this, I want to get a report of all projects in the server, with all users associated to that project. I can’t seem to do this right now with the api/project/search endpoint or the api/users endpoint… at least there’s no direct way to do it.
Why do I need this:
I need to analyze my instance usage and license consumption. I’m already using the api/project/license_usage endpoint, which gives me “lines of code” and “% used” for that repo, but as mentioned earlier, I don’t have a way to link all users to those repos. I use this data to reach out to the teams so that we can understand how they use SonarQube, figure out whether they’re properly using exclusion rules, and discuss their quality profiles. This helps with enablement and further adoption in my company.
What have I tried:
I already tried using api/users/search
I already tried using api/v2/users-management/users
I already tried using api/v2/authorizations/groups
I already tried using api/projects/license_usage
There’s no direct connection to a user email address and a projectkey
Sample report:
- user email address
- projectname
- projectkey
- linesofcode
- percent_license_used