test for variables

17 views
Skip to first unread message

Kenneth Johansson

unread,
Apr 28, 2017, 7:38:42 AM4/28/17
to Jenkins Users
I want to test if a property on a job exist att all. and then do
something depening on if it true or false.

if the property exist there is no issue testing if its true or false but
I do not want to force the job to have to create the property so I want
to test if the variable exist and that fails as it is always false all
the time.

if ( getBinding().hasVariable("my_param") ) {
echo "YES"
} else {
echo "NO"
}


also I wanted to getVaraiable to get it but that is not allowed.


kenneth johansson

unread,
Apr 28, 2017, 8:03:13 AM4/28/17
to jenkins...@googlegroups.com
What I really want to do is having a list of possible boolean parameters
and convert that to list of parameters that contain only the ones set to
true.


Reply all
Reply to author
Forward
0 new messages