StartParameter method doesn't override 'org.gradle.parallel' property

I would like our build to run in parallel in certain environments, so I have investigated calling the StartParameter method to turn parallel execution on and off.

After setting org.gradle.parallel=true in the file,

I have this code in our root project build.gradle file

if (userprops.get(‘’)) {
StartParameter sp = gradle.startParameter.newInstance()
sp.setParallelProjectExecutionEnabled(false)"*****Parallel is off");

I have confirmed it runs, but the build continues to use 8 parallel threads - what am I missing, and is this possible?