title: Jenkins parameterized job that only queues one build
body: <p>Imagine a Jenkins job A which takes 1 minute to run, and job B which takes 5 minutes. </p>
  
  <p>If we configure job A to trigger job B, while job B is running job A may run 5 times before B completes. However, Jenkins doesn't add 5 builds to job B's queue, which is great because otherwise speedy job A would be creating an ever-growing backlog of builds for poor slow job B.</p>
  
  <p>However, now we want to have job A trigger B as a parameterized job, using the <a href="http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Trigger+Plugin">parameterized trigger plugin</a>. Parameterized jobs <em>do</em> queue up a backlog, which means job A is happily creating a huge pile of builds for job B, which can't possibly keep up.</p>
  
  <p>It does make sense to add a new parameterized build to the queue each time it's triggered, since the parameters may be different. Jenkins should not always assume that a new parameterized build renders previously queued ones unnecessary.</p>
  
  <p>However, in our case we actually would like this. Job A builds and packages our application, then Job B deploys it to a production-like environment and runs a heavier set of integration tests. We also have a build C which deploys to another environment and does even more testing, so this is an escalating pattern for us.</p>
  
  <p>We would like the queue for our parameterized job B to only keep the last build added to it; each new build would replace any job currently in the queue.</p>
  
  <p>Is there any nice way to achieve this?</p>