Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Regex Validator not recognizing the default text

Jon Karnofsky
Contributor
September 11, 2023

I have a multiline custom text field which I would like have a default value, but validate during one transition that the value is still not the default value. I have a strong preference to not use Jira Automation, but the Workflow editor (but it's definitely a fallback option!)

I have put in a multiline default value (this is an example, my actual one is 9 lines):


Line 1: 

Line 2: 

Line 3: 


I have a required field validator (which works fine), and I have added a Regex validator:

^(?!Line\s1:\s\nLine\s2:\s\nLine\s3:\s)[\s\S]*$

So this does a negative lookahead for the specific value and fails if it find it exactly (even if there's other stuff directly after). But, it passes if there's even one character difference, which is what I want.

So here's what's weird that I don't understand and need help with:

  1. I create the issue, the default value is in the field fine
  2. I go from Status A to Status B it allows the transition (which it shouldn't)
  3. I revert back to Status A
  4. I edit the field, copy the entire field, simply paste the entire thing on top of itself, and save the field
  5. I try to transition to Status B, the failed validation message occurs

Is there something special about default values that it doesn't register as either empty, or the actual default value text? I don't understand why it seems to accept the text value if I paste over the default value with itself.

Thanks!

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events