Issue
Is there a way to use a global pipeline library when defining an Active Choices Reactive Parameter in Jenkins?
I have added a global pipeline library in Jenkins, let's say PipelineLibrary
, and I am able to use it successfully in my pipelines by loading it with @Library('PipelineLibrary') _
. In this library I have a global function foo.bar()
, which I would like to use also in the Groovy Script box when adding an Active Choices Reactive Parameter to several of my jobs.
So I would like to have something like this in the Groovy Script box of that parameter:
// Somehow take into use PipelineLibrary
return foo.bar();
What is the correct syntax to load the library here? Or is it even possible? If not, is there some other way to share the Groovy script to several places without just copy-pasting the code in the GUI?
Solution
I think you're banging on this door - JENKINS-46394
Answered By - Chuck Heatherly
Answer Checked By - Robin (JavaFixing Admin)