I have to create/update a jenkins job using its api because all of my jobs are using parameters which are also used by other scripts and I am trying to centralize the script
You might want to consider using https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin.