Title: Message Title
Jakub Bochenski updated an issue
Jenkins / JENKINS-40074
Unable to add Execute system Groovy script step via DSL
Change By:
Jakub Bochenski
I tried doing this as a workaround for JENKINS-40022{code} promotion { name 'Push to Nexus' icon 'star-blue' conditions { manual 'qa' } actions { systemGroovyCommand ''' String id = 'nexus' String url = '' new hudson.plugins.promoted_builds.tasks.RedeployBatchTaskPublisher(id, url , true) .perform(manager.build, null, manager.listener) ''' } }{code}Unfortunately if I try to add this step via DSL it's not executed and it doesn't show in WebUI (config page).There are no errors in Jenkins log during DSL execution. {code}Nov 28, 2016 3:25:24 PM INFO javaposse.jobdsl.plugin.JenkinsJobManagement createOrUpdateConfigcreateOrUpdateConfig for acme-Installer-DSLNov 28, 2016 3:25:24 PM INFO hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint notifyItemUpdatedUpdating promotions for acme-Installer-DSLNov 28, 2016 3:25:24 PM INFO hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint notifyItemCreatedCreating promotions for acme-Installer-DSLNov 28, 2016 3:25:24 PM INFO hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint notifyItemCreatedUpdated promotion with name Release to QA for acme-Installer-DSLNov 28, 2016 3:25:24 PM INFO hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint notifyItemCreatedUpdated promotion with name Push to Nexus for acme-Installer-DSLNov 28, 2016 3:25:24 PM INFO hudson.plugins.promoted_builds.integrations.jobdsl.PromotionsExtensionPoint notifyItemCreatedReloading config for acme-Installer-DSL Nov 28, 2016 3:25:25 PM INFO javaposse.jobdsl.plugin.JenkinsJobManagement createOrUpdateConfig {code}I can add a regular "Execute Groovy script" via DSL by changing {{systemGroovyCommand}} to {{groovyCommand}} but that's useless. Adding a "Execute system Groovy script " step manually works fine.Comparing the manual and DSL-generated config files the most notable difference is lack of {{plugin="groovy@1.30"}} attribute on the {{hudson.plugins.groovy.SystemGroovy }} element.DSL config.xml{code} Push to Nexus star-blueqa,engineering String id = nexus String url = ""> new hudson.plugins.promoted_builds.tasks.RedeployBatchTaskPublisher(id, url , true) .perform(manager.build, null, manager.listener){code}Manual config.xml{code} false false false false falsefalseqa,engineering star-blue String id = nexus String url = ""> new