Hi Team,
We have a custom field called the "Desired Product Account name" field with a single-line text box (The field should take "alpha numeric"). I need the validation to check for max chars (maximum is 20 chars between "AWS" and the environment of nonprod/prod)
Example : aws |[Text box with 20 Max chars]| nonprod/prod
Hi @Lakshmi S
You can use a JMWE Scripted Validator with code like this:
issue.get("Desired Product Account name")?.toLowerCase() ==~ /^aws\w{1,20}(prod)|(nonprod)$/
Hi @David Fischer ,
How to prefilled the these values in the field ?
aws and nonprod/prod ? the validation for in between those 20 chars max. Should i add default value of that to the field ?
aws |[Text box with 20 Max chars]| nonprod/prod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure how you can pre-fill the value - I guess you could have a default value showing the "template" for the value. But the validator will only validate that the value entered in the field is correct: it starts with aws, it ends with either prod or nonprod, and in-between is 1 to 20 alphanumeric characters.
Alternatively, you could use a post-function to automatically add "aws" and "prod" or "nonprod" to the value that's input in the field by the user, and have the user only input the 1 to 20 characters in-between.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @David Fischer . The JMWE script validation is perfectly working, and the post function suggested by you for pre-fill value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lakshmi S scriptrunner could handle this with a custom scripted validator you could probably even put it into a screen behaviour and address the validation before the end user hits submit(create/update) on the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.