We have some multi-branch pipeline jobs which are set up via Jenkinsfiles.
When we were setting up the jobs, we used build parameters to parameterize the build.
Now this is not relevant anymore, so we removed the parameters from the Jenkinsfile.
But they are still visible via the UI and the “build” button is still a “build with parameters” button.
The configuration of each branch only lists the parameters.
But they cannot be deleted and the “this build is parameterized” checkbox is activated but greyed out.
@pmon try to add empty parameters notation to your Jenkinsfile like this:
properties([
parameters([])
])
If it will not help you have to use groovy from scripted console to manually obtain job’s object and remove parameters from it. I can just provide an example how to obtain a job, but I have not experience with code which allows to remove parameters from job. Here is how we you can use it:
import jenkins.model.Jenkins
def jobName = "your-multibranch-pipeline-name"
def jenkins = Jenkins.instance
def job = jenkins.getItemByFullName(jobName)
if (job == null) {
println("Could not find the Multibranch Pipeline: $jobName")
return
}
if (pipeline instanceof org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject) {
def branchProjects = pipeline.getItems()
branchProjects.each { branch ->
// Do your staff
}
}