23

I'm using the Parameterized Build Plugin in Jenkins. I want to provide a link to the build page, but configure the default value for one of the fields that shows up in the form. This value is going to be different every time the job is run, but I want it to be configurable from some other page. Essentially I want to do something like click on a link that looks something like this:

https://jenkins/job/Sandbox/build?delay=0sec&Test=foo

And see this on the build screen:

Jenkins build with default parameter Test=foo

So then I can fill out the rest of the values (or even modify the default value) and then click Build. Is this possible?

3 Answers 3

23

Yes, it's absolutely doable - there is a plugin for that:

Build With Parameters Plugin.

Just install it and change the url to actually use the plugin:

https://jenkins/job/Sandbox/parambuild?Test=foo

And that's should do it...

Sign up to request clarification or add additional context in comments.

1 Comment

Builds, Parameterized Builds, Builds With Parameters, Jenkins has it all. Thanks - that plugin does exactly what I need.
20

You don't need any additional plugins for this. This comes natively with Jenkins

https://jenkins/job/Sandbox/buildWithParameters?delay=0sec&Test=foo
The above will trigger the build job immediately (or whatever the delay may be). This is suitable for automation.

The Build With Parameters Plugin is similar, but it will open a Jenkins confirmation page with pre-populated parameters (from the URL), and prompt the user to click the Build button. It is not suitable to automation.

4 Comments

Thanks for mentioning the fact that you can pass parameters without any additional plugins. It's not exactly what I needed for this use case, but this is the correct approach when you want to skip the build screen.
In installation I use it says "You must use POST method to trigger builds. (From scripts you may instead pass a per-project authentication token, or authenticate with your API token.) If you see this page, it may be because a plugin offered a GET link; file a bug report for that plugin." but there is "Proceed" button, and after clicking it it works.
How can we avoid clicking Proceed button? Every time I have to click it manually and it is not anymore automated.
@limonik use /buildWithParameters?token=mytoken&Test=foo. The "token" needs to be set on per-project configuration under "Build Triggers > Trigger builds remotely" section
0

You can work with build triggers /build?token=TOKEN_NAME or /buildWithParameters?token=TOKEN_NAME&Test=foo&AnotherTest=(your value)

1 Comment

Hello All, I am looking for Build triggers with delay option and will send some parameters like above /build?delay=0sec?token=TOKEN_NAME&Test=foo, but it is not working.. please suggest any

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.