How to access parameters in a Parameterized Build?

前端 未结 10 2096
你的背包
你的背包 2020-11-29 04:44

How do you access parameters set in the \"This build is parameterized\" section of a \"Workflow\" Jenkins job?

TEST CASE

10条回答
  •  星月不相逢
    2020-11-29 05:41

    Hope the following piece of code works for you:

    def item = hudson.model.Hudson.instance.getItem('MyJob')
    
    def value = item.lastBuild.getEnvironment(null).get('foo')
    

提交回复
热议问题