How to re-run Parameterized Jenkins Job again via code (without using rebuild plugin through UI)?

Viewed 854

I have 80 jenkins jobs which I want to re-build programmatically. All 80 were run with different set of parameters. I can see 2 approaches here for job x which is inside a view as well as folder,

  1. Use some Jenkins API to build x job just by specifying the job id(aka job_url)for x job
  2. Traverse and find out parameters of the x job and use Jenkins API to build x job using those parameters.
  3. Some Groovy Script (I have no experience writing this)

Rebuild plugin is something which essentially does 1) but I want to do the same via code. Please suggest specific solution if possible instead of generic API links. I have gone through all XML, JSON and Python API for Jenkins but there isn't one straightforward way I could find. Thanks.

1 Answers
Related