Hi Community,
I'm trying to use conditional execution in JMWE addon.
Below is the condition I'm trying on two text fields. If there is a word approved or deferred text in the field i need to execute this condition.
No luck with the below condition.
{{ issue.get("customfield_14802") == /.*Approved.*/ or issue.get("customfield_14802") == /.*Deferred.*/ }}
TIA!
Hi @Ash , you seem to want to use regular expressions in your test. In Groovy, the regex matcher operators are =~ (substring match) and ==~ (exact match). So you can try:
issue.get("customfield_14802") ==~ /.*Approved.*/ || issue.get("customfield_14802") ==~ /.*Deferred.*/
although that will also match "DisApproved" (because you didn't use a word begin/end pattern (\b) and won't match "approved" because you didn't use case-insensitive matching with (?i).
A better test would be:
issue.get("customfield_14802") =~ /(?i)\b(approved|deferred)\b/
Thank you @David Fischer . Appreciate your help as always.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.