Retrieve only technical debt information via WebAPI

Hi all.

I try to retrieve some project metrics via the WebAPI. WIth that I like to retrieve simply the technical debt of a project.

I found that api/issues/search?componentKeys=<project> returns me that information, but also all issues in details, which is fine to work with, but I was wondering, whether I can somehow parameterize the request to only get the “high” values, not the issues themselves.

Like when using api/issues/search?componentKeys=<project>&facetMode=effort&facets=types&types=CODE_SMELL, i also get some information in addition, but also the huge list of issues themselves.

Thank you for any support here

I think what you’re looking for is GET api/measures/component, using metricKeys like code_smells and sqale_index.

thank you very much for the answer. This helps me for the metrics, but not for the bugs, right ?

is there also an API “shortcut” to get the number of bugs ? or is the api/issues/search with CODE_SMELL the way-to-go?

Just swap out code_smells for bugs if you’re interested in the count of bugs.

If you need details, GET api/issues/search is indeed the way to go.

1 Like