-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.346.3
Plugin version 2.6.3
Jenkins in k8s cluster (1.22.4)
I have a helper function in shared library which retrieves build description by job name and build number. When I add active choice parameters to Jenkins pipeline, this function stops working, Jenkins.instance.getItemByFullName returns null.
Removing Active choice parameters restores the functionality and Jenkins.instance.getItemByFullName returns build object.
I've tried enabling and disabling sandbox for Active Choice paramters' scripts, but it doesn't change the situation.
Moving the helper function's code from shared library to Jenkinsfile solves the problem and the function returns a build object.
Steps to reproduce:
- Create shared library with function from attachments.
- Create a pipeline which used this shared libarary.
- Add active choice paramter (I had 1 active choice and 1 active choice reactive parameters).
- Run pipeline and observe error "java.lang.NullPointerException: Cannot invoke method getDescription() on null object" in job's log.
- Remove reference to shared library and define function in pipeline instead.
- Run pipeline and observe build description in output.
Attachments description:
- Function source code which used in shared library: getBuildDescription.groovy
- Jenkinsfile (pipeline code used in job): Jenkinsfile
- Job with parameters and pipeline code (Jenkinfile duplicates pipeline code): config.xml