I think the problem is with your regex match. Based on http://mrhaki.blogspot.com/2009/09/groovy-goodness-matchers-for-regular.html <http://mrhaki.blogspot.com/2009/09/groovy-goodness-matchers-for-regular.html>, it looks like the operator to use is `==~`, but you have `== ~` with a space.
The stage is skipped correctly if I use `Development ==~ /(?i)(1|Y|YES|T|TRUE|ON|RUN)/` (remove the space before the ~). > On Aug 28, 2018, at 21:49, MDKF <[email protected]> wrote: > > Hi All, > I have the following pipeline. I don't expect the steps in the when > condition to run, but they are. Can anyone tell me what i'm doing wrong? (I > know using an expression instead of a simple equals is overkill, but this is > a simplified example to show my issue) > -Michael > > pipeline { > > // Discarded: Promote Builds When... > > agent any > environment { > Development = true > } > stages { > stage('test') { > when { > not { > expression { > Development == ~/(?i)(1|Y|YES|T|TRUE|ON|RUN)/ > } > } > } > steps { > echo 'Development is false' > } > } > } > } > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/f76ece7d-c962-4914-bdbd-c8addfb58ea9%40googlegroups.com > > <https://groups.google.com/d/msgid/jenkinsci-users/f76ece7d-c962-4914-bdbd-c8addfb58ea9%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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/4C2474BB-A780-458B-9EBD-DFCB5C29F9BB%40cloudbees.com. For more options, visit https://groups.google.com/d/optout.
