Love the job-dsl-plugin api viewer i.e. <base url>/jenkins/plugin/job-dsl/api-viewer/index.html
However when browsing the generated dsl for the extensibleChoiceParameter plugin i.e.:
However having tried this DSL:
ERROR: (script, line 15) No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.whenToAdd() is applicable for argument types: (java.lang.String) values: [triggered]
Looking up the plugin source code it does appear to want an ENUM:
So the bug is that I think the api-viewer is generating the wrong DSL.
I would perhaps not have raised this, but I don’t seem to be able to get the generated DSL to work at all. Since the ENUM seems to exist in a class that appears to need to run as System Groovy, I can’t import that class in my Job DSL groovy. E.g.
def temp = new jp.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListProvider()
unable to resolve class jp.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListProvider
unless I run in System Groovy step:
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: jp.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListProvider()
(shows class is found)
So possibly another issue is that dsl for classes that have to run as System Groovy don't work if you need ENUMs.
So I'm raising this bug primarily because I think the generated DSL is incorrect in some circumstances.
- But also on the off chance that anyone can shed any light on getting my generated DSL working. Thanks in advance!