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
You can test regex code here :- https://regex101.com/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Thanks
Prashant Sultania
Note: Upvote, Like or Accept Answer if it resolves your query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @RSP
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
Thanks
Prashant Sultania
Note: Upvote, Like or Accept Answer if it resolves your query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.