I have created "Number of Team Members" custom field. The acceptance criteria for this field is value should be integer. The number field is accept float value which is not acceptable.
I am using scriptRunner in case script is required.
Hi @RSP It's very simple to implement using Script Runner Validator.
Kindly use validator "Simple scripted validator" and apply below condition :-
cfValues['CA Ticket#'] ==~ /^[0-9]*$/
Kindly replace CA Ticket# with your number field or text field.
^[0-9]*$ :- Allow only Integers
^[0-9]+$|^$ :- Allow integers and blank space
Hope it works for you!
Let me know the result!
Thanks
Hello @RSP
Welcome to the community !!
Yes, you can apply acceptance criteria for the integer field (Custom Field). You can use the Unique Regex Custom Field macro/plugin in your jira instance. By using this you can restrict the entered values as per your business requirements.Unique Regex Custom Field
ThanksPrashant Sultania
Note: Upvote, Like or Accept Answer if it resolves your query.
Is it possible to add validator ?
We don't use plugin
Yes, it is possible to add the Validator using ScriptRunner. So, you have to use custom_field_ID or Custom Field name in your scriptrunner. I am sharing the scriptrunner documentation on "How to use the custom field as the validator in the code". I Hope, this document will help you. scripted validators tutorial
You can test regex code here :- https://regex101.com/
It looks like you're new here. Sign in or register to get started.