Currently I'm setting a buildDiscarder option in my declarative Jenkinsfile.
The problem is that I cannot setup a different strategy per branch.
Why do it need this? Well, I'd like to keep during more time the build and artifacts of the master and release/* branches while I keep a low number for any other branch.
I'm sure this will be useful for a lot of people.