LOC Notification Threshold resets after upgrade – add Web API support

Hi

I’m currently using SonarQube Developer Edition with an active license. In the License Manager settings I configured the “Notification Threshold” to a value of 100,000 LOC to monitor license usage more precisely.

However, I’ve noticed that after each upgrade to a new SonarQube version (e.g., from 2025.1 → 2025.2 → 2025.3), this threshold gets reset to the default value of 200,000 LOC. This requires manual reconfiguration after every upgrade, which is not ideal for automated deployments.

I’d like to request the ability to set or update the LOC Notification Threshold via the Web API, so that this setting can be automatically restored or managed through infrastructure-as-code tools after upgrades.

Is this currently possible through any existing API endpoint?

1 Like

Hi,

Everything that happens through the UI happens via an API, so yes, there’s an API for this, although it may not be marked ‘external’. If it’s not, then it’s subject to change without warning (although for this particular one you’re likely to be pretty safe.)

The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.

You may also find this guide helpful.

OTOH, you shouldn’t have to keep resetting this, so I’m going to refer this internally.

 
Ann

2 Likes

Hello @paxlo thanks for signaling this behavior.

I am trying to reproduce locally because by looking at the code I see no reason why this should happen.
Setting that value results in an API call that stores the value in the Database in the properties table.
The LOC threshold property is reset when setting a new license, but I don’t think that is your case when updating from version 2025.1 to 2025.2 or 2025.3.

The manual set of an updated license will justify this behavior, but not a simple upgrade.
I will add more details once my local test is complete.

I did a full test locally and I did not managed to reproduce this behavior.

I started from version 10.8.1, I set a valid Enterprise license and the notification threshold to 123456.

Then, leveraging the same DB I upgraded everything to 2025.1 and validated that the license threshold was the same.

I did the same operation with 2025.2 and still the threshold was the same one.

I would check if the license is being set at each upgrade, because that would justify this reset. In my case the license was not touched after setting it the first time in version 10.8.1.