You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jenkins升级后Active Choices Parameter插件失效问题求助

Jenkins升级后Active Choices插件功能失效

原环境(Jenkins 2.440.1 + Active Choices Plug-in 2.8.3)下,Active Choices插件的Groovy脚本功能正常运行。但将Jenkins升级至2.479.3版本、插件升级至2.8.6版本后,插件完全无法正常工作。

相关界面截图:

截图1:Active Choices参数加载失败,无预期选项展示
截图2:脚本执行过程中出现错误提示

我使用的Groovy脚本如下:

import jenkins.model.*
import groovy.json.JsonSlurper

credentialsId = 'sre-bugatti'


try {
    def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
        com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class, Jenkins.instance, null, null ).find {
            it.id == credentialsId
    }

    def user = creds.username.replaceAll('@', '%40')
    def pass = creds.password.toString().replaceAll('@', '%40')

    def cmd = "curl http://${user}:${pass}@${baseUrl}/user?page=0&pageSize=1000&jobNo="
    def proc = cmd.execute()
    def out = new StringBuffer()
    def err = new StringBuffer()

    proc.consumeProcessOutput(out, err)
    proc.waitForOrKill(5000)
    // println(out)
    def jsonSlurper = new JsonSlurper()
    def resp = jsonSlurper.parseText(out.toString())
    return resp.jobNo
} catch (Exception e) {
    print(e)
    return [e]
}

注:脚本中jobNo参数依赖上游的baseUrl参数,后续的name参数又依赖jobNo参数。

请问有没有人遇到过相同的情况?

内容的提问来源于stack exchange,提问作者Logn Xu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 23:48:22