Query the project owners in the Database

I am using Sonarqube 7.9.4 with postgresq as DBMS.
I am trying to query all the emails of the project owner.
I will like to know how I can join projects table and users tables. if someone have another method to have that query I will be very happy.

Hello @fekam and welcome to the community :wave:

your SonarQube Version is EOL! you should upgrade to at least the current LTS (8.9.1)!

regarding your initial question; there are two internal API endpoints that you could use to get the required information:

  • api/permissions/users
  • api/permissions/groups

both of them accept a projectKey and a permission parameter for a specific project, so something like this:

curl -u <username>:<password> http://localhost:9000/api/permissions/users?projectKey=<your project key>&permission=admin&ps=100

same for groups.

as these are internal API endpoints, they can be changed any time without notice, but so can the database schema. these api endpoints did not change for a while thou.

hope that helps :slight_smile: