While creating a New Item in Jenkins through UI, we have an option to "Copy existing Item". I want to be able to do the same by using Job DSL plugin.
I tried the copyArtifacts method. But its not copying the item. My copyArtifacts code is below
job(jobName){
steps{
copyArtifacts('template_job'){
includePatterns('config.xml', '*.properties')
}
}
Am I going wrong with this code, or is there a different way to copy existing item using Job DSL plugin.