def groovy_script(registry, xml_parent, data):
 gst = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.scripttrigger.groovy.GroovyScriptTrigger')
 gst.set('plugin', 'scripttrigger')
 mappings = [('system-script', 'groovySystemScript', False), ('script', 'groovyExpression', ''), ('script-file-path', 'groovyFilePath', ''), ('property-file-path', 'propertiesFilePath', ''), ('enable-concurrent', 'enableConcurrentBuild', False), ('cron', 'spec', '')]
 convert_mapping_to_xml(gst, data, mappings, fail_required=True)
 label = data.get('label')
 XML.SubElement(gst, 'labelRestriction').text = str(bool(label)).lower()
 if label:
  XML.SubElement(gst, 'triggerLabel').text = label

def groovy_script ( registry , xml_parent , data ) : gst = XML . SubElement ( xml_parent , 'org.jenkinsci.plugins.scripttrigger.groovy.GroovyScriptTrigger' ) gst . set ( 'plugin' , 'scripttrigger' ) mappings = [ ( 'system-script' , 'groovySystemScript' , False ) , ( 'script' , 'groovyExpression' , '' ) , ( 'script-file-path' , 'groovyFilePath' , '' ) , ( 'property-file-path' , 'propertiesFilePath' , '' ) , ( 'enable-concurrent' , 'enableConcurrentBuild' , False ) , ( 'cron' , 'spec' , '' ) ] convert_mapping_to_xml ( gst , data , mappings , fail_required = True ) label = data . get ( 'label' ) XML . SubElement ( gst , 'labelRestriction' ) . text = str ( bool ( label ) ) . lower ( ) if label : XML . SubElement ( gst , 'triggerLabel' ) . text = label
yaml: groovy-script triggers the job using a groovy script .