Hi, I need to validate a custom field value. The format is CRQ<0-9>. Total digits have to be 12. I used the below code.
if((issue.customfield_10063.match("CRQ[0-9]{12}")) ||
(issue.customfield_10063 == null)) {
true
}
else {
false
}
The script throws error if the field is blank
The scripts accept more then 13 digits as well and does not throw error
How do i ensure that it allows blank or accepts CRQ followed by 0-9 digits of length 12 only?