Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving Jenkins job name using groovy script in Active Choice Reactive Parameter

I am unable to retrieve the Job name using groovy script below. Even when I run this script in the Execute System Groovy Build Step, it gives me the error as. Error:

groovy.lang.MissingPropertyException: No such property: jenkinsProject for class: groovy.lang.Binding

----
def jobName = this.binding.jenkinsProject.name
----

I found in the below link that it has worked for someone, but somehow not working for me. Can anyone help please?

How to get the job name on a groovy dynamic parameter in Jenkins

like image 735
Ritesh Keloth Avatar asked Dec 20 '25 21:12

Ritesh Keloth


1 Answers

The v1.3 and v1.4 (released in a couple of days once manual testing is done) both should support this feature. Just use jenkinsProject in you code and that should work fine. Other wise just let us know via issues.jenkins-ci.org, component=active-choices-plugin.

The v1.4 has a bug fix that allows you to use this variable with Matrix projects as well.

Hope that helps, Bruno

like image 117
Bruno P. Kinoshita Avatar answered Dec 24 '25 11:12

Bruno P. Kinoshita



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!