Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,679
Community Members
 
Community Events
168
Community Groups

How to perform Regular Expression Check (JSU) only when field is not empty

Hello,

I have a custom field called Digit in create screen. Requirement is to check if field is having only 10 digits in it. For that I have used Regular Expression Check (JSU).

But it is also checking the validations when field is empty. I need that when field is empty nothing to be checked and when it has value need to check if its having only 10 digits or not.

1 answer

1 accepted

0 votes
Answer accepted

Isn't the regex extended, in a sense you could do

^([0-9]{10}|)$

Where the | pipe serves as "or". I haven't tested above but I remember I set up a couple of those before. 

Hi @Radek Dostál ,

Thanks! It worked.

Regards,

Preeti Yadav

Suggest an answer

Log in or Sign up to answer