I'm trying use a PT_SINGLE_SELECT CascadeChoiceParameter. I'm using a batscript that returns a list of branch names, called choices. For reasons I cannot change the batscript as it's out of my controll. The batscript returns the list sorted, but I need some elements moved to the top of the list.
def now = LocalDateTime.now()
def releaseString = "saas/${now}/${now.year}/${now.month.getDisplayName(TextStyle.FULL, locale.ENGLISH).toLowerCase()}/main"
['saas/master', releaseString].each {entry ->
choices.remove(entry)
choices.add(0, entry)
}
return choices
When I push the Run With Parameters button in Jenkins the expected string saas/2025/march/main shows up for a few seconds before it changes to [object, Object]. If I hard code the expected string then it works as intended. So for some reason the releaseString is not treated as a string in this case.