Hi,

Am Montag, 21. Februar 2022, 15:28:09 CET schrieb Thomas Markus:

> How can I use a library function for this? Currently I have to copy my

> scipt.


You mean using a function from a custom pipeline library for a scripted value 
of the extended choice? I don't think this is possible. As the script for the 
extended choice parameter is executed _before_ the job has started, the library 
will not be available.

When using a library inside a run (@Library decorator or library() function), 
Jenkins will check out a working copy of the library into a special @lib 
folder. The groovy code is then loaded from there and can be used inside the 
pipeline. But, this happens only when the build is actually started.


See also 
https://stackoverflow.com/questions/53636109/how-can-i-include-a-shared-library-in-the-jenkins-script-console
--

Christoph

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5127844.BWT4rc3Yii%40lmi-nb49.

Reply via email to