I found another way to prevent jenkins from overriding parameter values with each run. Seems to be working with latest declarative pipelines:
string(name: 'BRANCH', defaultValue: params.BRANCH ?: 'master')
If no param yet then it will use master, otherwise it will use whatever has been set in the defaults "manually" in the job configuration.
Thanks a lot, Crazily This info is not available any where.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.