capabilities.work

Trigger a Parameterized Build and Await the Result

A 4-step recipe with Jenkins. We can help you get access.

Recipe · 4 steps

Trigger a Parameterized Build and Await the Result

with Jenkins · Continuous Integration Management

Run a parameterized Jenkins job with supplied values and wait for the result.

  1. Read the job to confirm it exists and is buildable, and to capture the number the next build will be assigned.
  2. Trigger the job with the supplied parameter values, form-encoded as Jenkins expects. Jenkins responds 201 with a Location header pointing at the created queue item.
  3. Read the build queue to confirm the parameterized trigger was accepted and to see whether the build is still waiting for an executor.
  4. Poll the build resource until it reports it is no longer building, then capture the final result and the parameters the build actually ran with.
What you'll need to have ready
  • jobName: The name of the parameterized Jenkins job to build.
  • parameters: Map of build parameter name/value pairs to submit, matching the job's configured parameter definitions (e.g. {"BRANCH": "main"}).
For your developer

Arazzo workflow jenkins:trigger-parameterized-build, 4 operations: getJob → triggerBuildWithParameters → getQueue → getBuild. Specs on APIs.io.