最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jenkins - CascadeChoiceParameter shows up as [object,Object] instead of string - Stack Overflow

programmeradmin5浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论