Answers: <p>Depending on how long you keep builds for, the Rebuild option in the left hand sidebar will allow you rebuild a previous run of the job with the parameters intact. </p>
  
  <p>Simply find a previous build of the job that that particular user kicked off last time, click into it, then choose Rebuild from the sidebar. </p>
  
  <p>Again this will only work if Jenkins keeps enough builds. We save two weeks for a particular job and I have a coworker who saves a link directly to x build of the job, then once he rebuilds updates his link to the new one, etc. This way he can just open the link he has saved, click Rebuild, and he's good to go as long as he's inside that two week window.</p>
  
  <p>I believe you can even choose to <code>Keep this build forever</code> for a couple of your "template" builds, making them more easily accessible. </p>
  
Answers: CC BY-SA 4.0
Answers: 2018-07-19T19:23:37.537Z
Answers: Is there a way to tell Jenkins to keep a build for x number of days instead of saying how many builds to keep?
Answers: Asdfg
Answers: CC BY-SA 4.0
Answers: 2018-07-19T19:51:09.463Z
Answers: @Asdfg yep! You can pick either days or number of builds on the config page.
Answers: Alex
Answers: CC BY-SA 4.0
Answers: 2018-07-19T19:19:32.357Z
Answers: 2018-07-19T19:19:32.357Z
Answers: Alex
Body: <p>I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e.</p>
  
  <pre><code>1) GCP Project Name
  2) Number of RHEL Servers
  3) RHEL Server names
  4) Number of CentOS Servers
  5) CentOS Server names
  </code></pre>
  
  <p>This is a standard build job and users cannot build servers if not using this build.</p>
  
  <p>The problem is that when a user comes back to request more servers, they have to fill up all the details again. They have to remember all the values they passed previously.</p>
  
  <p>So the questions is: How do I make this user friendly without creating a separate build job for each GCP project and hard coding the values.</p>
  
Tags: <jenkins><jenkins-pipeline><terraform>
Title: Jenkins Pipeline job - remember previous values
UserDisplayName: Asdfg
ThreadText: # Jenkins Pipeline job - remember previous values
  
  (Asked by: username_0 on 2018-07-19)
  
  I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e.
  
  ```
  1) GCP Project Name
  2) Number of RHEL Servers
  3) RHEL Server names
  4) Number of CentOS Servers
  5) CentOS Server names
  
  ```
  
  This is a standard build job and users cannot build servers if not using this build.
  
  The problem is that when a user comes back to request more servers, they have to fill up all the details again. They have to remember all the values they passed previously.
  
  So the questions is: How do I make this user friendly without creating a separate build job for each GCP project and hard coding the values.
  
  **Tags:** jenkins, jenkins-pipeline, terraform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-19. Score: 2
  
  Depending on how long you keep builds for, the Rebuild option in the left hand sidebar will allow you rebuild a previous run of the job with the parameters intact.
  
  Simply find a previous build of the job that that particular user kicked off last time, click into it, then choose Rebuild from the sidebar.
  
  Again this will only work if Jenkins keeps enough builds. We save two weeks for a particular job and I have a coworker who saves a link directly to x build of the job, then once he rebuilds updates his link to the new one, etc. This way he can just open the link he has saved, click Rebuild, and he's good to go as long as he's inside that two week window.
  
  I believe you can even choose to `Keep this build forever` for a couple of your "template" builds, making them more easily accessible.
  
  > **Comments:**
  > **username_0**: Is there a way to tell Jenkins to keep a build for x number of days instead of saying how many builds to keep?  
  > **username_1**: @username_0 yep! You can pick either days or number of builds on the config page.  
  
  ---
  
  