salimfadhley/jenkinsapi — pull request #122 by rocktavious (2013-06-19 14:06:28+00:00)
Title: parameterized build fix

Hey Salim,

Sorry it took me a while to get to this and test it out, but after understanding the sample you provided in example_param_build.py and looking through the stack it seems we need this change.

To get a parameterized build to work we need to not pass in blank data field and
expect that params == dictionary of the parameters that should be
passed to requests.post method

The Example code I used to success on our work environment to determine this is below:
my_data_dict = {'parameter':[{'name':'MyVarString','value':'Hello World'}]}
json_data = json.dumps(my_data_dict)
params = {'data':{'json':json_data},'headers':{'Content-Type':'application/x-www-form-urlencoded'}}
jenkins.build_job('TestBuild',params=params)