How to do group categorization

Hello community,

My company has several different teams by business group and I would like to be able to programmatically determine group by data/metadata from the sonar projects.

Presently I use the SonarCloud API to pull all metrics by branch for all projects, into an excel workbook and create pretty little dashboards. It would be nice to then group by team and compare how each team is doing.

For example, we could add a tag to each project which contains the group name. And while it is easy to see that I can fetch all tags or create new ones I cant figure out how to pull tags by project. Nor are tags included in the project resource response. I am indifferent if tags are used or another more appropriate feature.

At the end of the day I can hard code projects by teams but I find that to be very displeasing.

What ideas do you have on how to pull tags or other means of grouping projects?

  • ALM: Bitbucket Cloud
  • CI: Bitbucket Cloud

Thanks

Hey there.

GET api/components/show will let you pull the list of tags associated with a project.

// https://sonarcloud.io/api/components/show?organization=sonarsource&component=sonarscanner-msbuild
{
   "component":{
      "organization":"sonarsource",
      "key":"sonarscanner-msbuild",
      "name":"SonarScanner for MSBuild",
      "qualifier":"TRK",
      "analysisDate":"2022-07-20T04:12:17+0200",
      "tags":[
         "dotnet"
      ],
      "visibility":"public",
      "leakPeriodDate":"2022-07-12T11:35:05+0200",
      "version":"5.8.0"
   },
   "ancestors":[
      
   ]
}

Perfect thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.