Hi,
I have a list contains some words. I want to add JMWE validator on "Description" field(multi-line text field) to check that description contains all or some of these words.
Suppose my list has words as - ABC, DEF, GHI, JKL, MNO, PQR, STU, VWX, YZ.
How can I set validator to make mandatory description field for these words ?
Thanks!
You can create a "Build-your-own" Validator, with a Jira expression like:
!!issue.description && issue.description.plainText.match("(?i)\bABC\b") != null && issue.description.plainText.match("(?i)\bDEF\b") != null
to test whether the description contains the ABC and the DEF words in a case-insensitive manner. That is:
Note that the \b before and after the word are there to indicate "word boundaries" (the beginning and the end of a word) so that "ABCD" doesn't match with "ABC".
If you want to test whether the description contains the ABC or the DEF words in a case-insensitive manner:
!!issue.description && (issue.description.plainText.match("(?i)\bABC\b") != null || issue.description.plainText.match("(?i)\bDEF\b") != null)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.