Complete the code to define a multi-branch pipeline job in Jenkins using the correct job type.
job = Jenkins.createJob('[1]', 'MyMultiBranchJob')
The MultiBranchPipelineJob is the correct job type to create a multi-branch pipeline in Jenkins.
Complete the code to set the Git repository URL for the multi-branch pipeline job.
job.setSource(new GitSCMSource('[1]'))
The HTTPS URL https://github.com/example/repo.git is the correct format for the Git repository URL in Jenkins multi-branch pipeline.
Fix the error in the code to correctly add a branch source to the multi-branch pipeline job.
job.getSourcesList().add(new [1](new GitSCMSource('https://github.com/example/repo.git')))
The BranchSource class is used to add a branch source to a multi-branch pipeline job in Jenkins.
Fill both blanks to configure the multi-branch pipeline job to scan branches every 1 day and set the script path.
job.setTriggers([new [1](1)]) job.setScriptPath('[2]')
PeriodicFolderTrigger schedules branch scanning every day, and Jenkinsfile is the default script path for pipeline jobs.
Fill all three blanks to complete the multi-branch pipeline job creation with credentials and orphaned item strategy.
job.setSources([new BranchSource(new GitSCMSource('[1]').withCredentials('[2]'))]) job.setOrphanedItemStrategy(new [3](7))
The Git repository URL is set to https://github.com/example/repo.git, credentials ID is github-credentials-id, and DiscardOldItemsStrategy removes old branches after 7 days.