Answers: <p>EDIT:
  It might have a chance for me to misread your question at the first time, so let me add another one. </p>
  
  <p>If you meant by Jenkinsfile as you have a manual parameter input in Jenkinsfile for Multibranch or Github Org pipeline, then probably bad idea.</p>
  
  <p>Those kind of jobs should run with predefined parameters or take them on-the-fly like manipulating some environment variables without user input.</p>
  
  <p>You can simply make another pipeline job for manual trigger if the predefined parameters can't cover all the case you need.</p>
  
  <p>And for run function, it looks like <code>build job</code> is what you are looking for.</p>
  
  <p><a href="https://jenkins.io/doc/pipeline/steps/pipeline-build-step/#-build-%20build%20a%20job" rel="nofollow noreferrer">https://jenkins.io/doc/pipeline/steps/pipeline-build-step/#-build-%20build%20a%20job</a></p>
  
  <pre><code>build job: 'Another job in same Jenkins server', parameters: [string(name: 'param1', value: ${new_value})]
  </code></pre>
  
  <h2>--------------------------------------</h2>
  
  <p>Are you sure the parameter input is waiting for slave containers?
  or do you use some special choice plugins for build parameter?</p>
  
  <p>I think a job is even not starting until a user fills out the parameters and hit the build button in Jenkins UI - so no container required until then.
  We had same k8s slaves, but never had that issue.</p>
  
  <p>(But some parameter plugins might need some pre process..)</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-08-22T01:31:09.487Z
Answers: 2019-08-22T01:54:32.993Z
Answers: 2019-08-22T01:54:32.993Z
Answers: kevmando
Body: <p>My build parameters are defined in my jenkinsfiles</p>
  
  <p>All builds run on container slaves on google kubernetes engine cluster</p>
  
  <p>This means users need to wait for a container to start before anything happens, including just updating the "Build with parameters" choices.</p>
  
  <p>Can I set parameters outside of the pipeline directive so it doesnt need to start a container to update the parameters?</p>
  
  <p>or even better maybe there is a way to have Jenkins run functions in my jenkinsfile to get the updated parameters when it scans branches?</p>
  
Tags: <jenkins><jenkins-pipeline><jenkins-plugins><jenkinsfile>
Title: Is there a way to set build parameters outside of the pipeline directive?
UserDisplayName: red888
ThreadText: # Is there a way to set build parameters outside of the pipeline directive?
  
  (Asked by: username_0 on 2019-08-22)
  
  My build parameters are defined in my jenkinsfiles
  
  All builds run on container slaves on google kubernetes engine cluster
  
  This means users need to wait for a container to start before anything happens, including just updating the "Build with parameters" choices.
  
  Can I set parameters outside of the pipeline directive so it doesnt need to start a container to update the parameters?
  
  or even better maybe there is a way to have Jenkins run functions in my jenkinsfile to get the updated parameters when it scans branches?
  
  **Tags:** jenkins, jenkins-pipeline, jenkins-plugins, jenkinsfile
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-22. Score: 1
  
  EDIT:
  It might have a chance for me to misread your question at the first time, so let me add another one.
  
  If you meant by Jenkinsfile as you have a manual parameter input in Jenkinsfile for Multibranch or Github Org pipeline, then probably bad idea.
  
  Those kind of jobs should run with predefined parameters or take them on-the-fly like manipulating some environment variables without user input.
  
  You can simply make another pipeline job for manual trigger if the predefined parameters can't cover all the case you need.
  
  And for run function, it looks like `build job` is what you are looking for.
  
  <https://jenkins.io/doc/pipeline/steps/pipeline-build-step/#-build-%20build%20a%20job>
  
  ```
  build job: 'Another job in same Jenkins server', parameters: [string(name: 'param1', value: ${new_value})]
  
  ```
  
  ## --------------------------------------
  
  Are you sure the parameter input is waiting for slave containers?
  or do you use some special choice plugins for build parameter?
  
  I think a job is even not starting until a user fills out the parameters and hit the build button in Jenkins UI - so no container required until then.
  We had same k8s slaves, but never had that issue.
  
  (But some parameter plugins might need some pre process..)
  
  
  ---
  
  