-
Improvement
-
Resolution: Not A Defect
-
Minor
-
None
I have a release build job on Jenkins where I extract the major+minor version numbers for the release from the chosen SVN release branch (provided as a "List Subversion Tags" parameter). This extraction is done as a groovy build step (using getTag() of hudson.scm.listtagsparameter.ListSubversionTagsParameterValue and split() of java.lang.String) which injects the major+minor version numbers as variables to build.
I now tried to provide the major+minor version number as build parameters using Reactive Reference Parameters (with choice type "Input Text Box") that should do this extraction in ther "Script" field of the parameter. Unfortunately I failed. When referring to a "List Subversion Tags" parameter I got an empty string. When returning the class of the referenced "List Subversion Tags" parameter to the text box I see the value "class java.lang.String". However, I would have expected something like "class hudson.scm.listtagsparameter.ListSubversionTagsParameterValue".
=> I am asking for a possibility to retrieve the string value of a "List Subversion Tags" parameter for Reactive Reference Parameters.
Hi cober, today I do not have time to try to reproduce the issue completely. But maybe a quick reply on this part would help?
>When returning the class of the referenced "List Subversion Tags" parameter to the text box I see the value "class java.lang.String". However, I would have expected something like "class hudson.scm.listtagsparameter.ListSubversionTagsParameterValue".
If I understand it correctly, your active choices parameter returned, when executing your Groovy script, value from another parameter as a String, opposed to an object from the Jenkins code base API.
That would be the expected behaviour. The plug-in works by parsing the HTML DOM. So it has access to only objects in the screen (plus the jenkinsProject variable we inject). So in an active choices parameter, the value returned from other parameters would be a string. And then in your Groovy script for that active choices parameter, you would have to query Jenkins in Groovy, retrieving the item/action/etc, and then populate the current active choices element.
Hope that helps
Bruno