The following \'Execute system Groovy script\' Build Task updates the build\'s description to add a button that will submit another Jenkins job which is parameterized:
You need to use JSON. See Submitting Jobs.
The following worked for me:
<button
type='button'
onclick='javascript:
var another_job = function() {
new Ajax.Request("http://localhost:8081/job/JReport2/build", {
method: "post",
parameters: {json: Object.toJSON({parameter: [{name: "foo", value: "fobar"}]})}
});
};
another_job()'>
Start Job
</button>
What's a bit strange that is works when the button that appears next to the build in the build list is pushed, but does not work with the button that appears on the build description itself.