API search and bulk_delete parameter analyzedBefore is null


(Jakob Berlin) #1

api/projects/search request has a analyzedBefore parameter

some projects on our SonarQube instance have no “lastAnalysisDate”

How I could search for/filter those projects with the search/bulk_delete endpoint? I’ve tried null|NULL|’’ but nothing worked. If not possible, could you provide this feature?


(Benoit) #2

Hello,

To clarify, what you want to do is to delete all projects which have never been analyzed, right?

Benoît


(Jakob Berlin) #3

Correct


(Julien Lancelot) #5

Hi Jakob,

If you want to delete project that has never been analyzed, there’s a “Only Provisioned” checkbox available in the “Administration” -> “Projects” -> “Management” page.
You can also use the WS api/projects/search with parameter onProvisionedOnly set to true.

Regards,
Julien Lancelot


(Jakob Berlin) #6

No, sry I’ve tried this already. I’ve projects which are not provisioned and have no analysis. May analysis were delete by garbage collection (removal of old analysis) in Sonar? Normally we don’t provision projects manually and they are created from CI jobs on demand.


(Julien Lancelot) #7

In fact the onProvisionedOnly parameter should also detect projects that have no more analysis.
If no project are returned when using it, it means that there’s at least one analysis on the project.


(Jakob Berlin) #8

But in fact it dosen’t. My only provisioned list is empty. My project list contains projects with no last analysis. Same results in API.


(Jakob Berlin) #9