I have a Jenkins job that has a single boolean parameter. The default value of this parameter is false. I remotely build it from an ANT build script (of another job) by POST'ing to the build URL and passing my token and parameter.
curl -X POST 'MY_JENKINS_SERVER/job/JOB_NAME/buildWithParameters?token=12345;REPORTS=true' --user MY_USERNAME:MY_PASS
Note that I have the URL enclosed in single quotes (which should take care of encoding issues) and that the name of the boolean parameter is REPORTS (capitalized in Jenkins and in ANT). Also, I'd like to note that if I use an ampersand (&) to separate the token and my other parameter I get the following error when building: The reference to entity "REPORTS" must end with the ';' delimiter.
No matter what the value of the REPORTS parameter is in the URL string, the parameter is always the default value of false when it goes to build. I changed the default value to true in Jenkins and it is always true regardless of the passed parameter value. Basically, it always uses the default value and ignores the passed parameter value. I've also tried passing no REPORTS parameter and of course it takes the default value.
In my job's build file (the one that I am triggering remotely), I print the parameter as ${env.REPORTS}
I've looked over similar questions on SO, but none of their solutions work for me. I've tried moving the parameters around in the URL and nothing seems to work. Any ideas?