i used the code from the answer of ...
How to submit Jenkins job via REST API?
... to insert a button to the job build descriptions.
Jenkins version : 1.645
The button is visible, but the onClick action is simply not created.
Do i have to install additional jenkins plugins to allow javascript or ajax actions? Thanks for your support!
job.builds
.findAll { build -> build.number == buildNumber }
.each { build ->
build.setDescription("""
<button
type='button'
onclick='javascript:
console.log("OnClick Action triggered!");
var another_job = function() {
new Ajax.Request("http://jenkins.alalala/hudson/job/AA_dummy_job_AUTO/build", {
method: "post",
parameters: {json: Object.toJSON({parameter: [{name: "SOME_JOB_PARA", value: "MY_VALUE"}]})}
});
};
another_job();
location.reload();'>Do Something!</button>""")
}