The Jenkins version includes the global discard jobs function, but it doesn't seem possible to override the function as shown here:
https://plugins.jenkins.io/build-discarder/
This problem has already been reported here:
What seems strange is that this plugin doesn't seem to be necessary because Jenkins natively has the Global Build Discarders function.
Manage Jenkins >> Configure System >> Global Build Discarders.
Has anyone already encountered this problem and is it a bug? For information, adding the plugin doesn't change anything.
The plugin is necessary as it runs the discarder only for those jobs that don't have a discarder configured.
Core brings 2 build discarders strategies:
So the specific build discarder only makes sense when you don't want to configure discarders on jobs. And then you shouldn't configure the discarder from the plugin.
Basically the plugin provides the solution for the problem in the linked community topic.
And of courses you need to configure the plugin, just installing it is not enough