I am using JMWE and need this validation for cost entered. Format Example: xx.yy€. How can i do it?
I need to validate the values entered and the symbol too.
What is the field type of the field that contains the value to be validated?
Also, at what point do you need to validate the value? Issue creation? During a transition?
Finally, you specified Confluence Server as your platform, did you mean Jira Server?
It is a custom field and we need to validate the value during issue creation .
Yes , my bad its Jira server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of custom field? Single line text? Number? Other?
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.
Then you can use a Scripted (Groovy) Validator with a script like:
issue.get("fieldId") ==~ /\d\d\.\d\d€/
which will pass only if the text field contains a string that's exactly two digits, a decimal point, two digits and the € sign. You can use a more sophisticated regular expression of you want to accept different formats.
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.
That works but in case i have to enter 245753.00 then do i need to give that many \d or we have any other way to do it ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case you can do:
issue.get("fieldId") ==~ /\d+\.\d\d€/
which forces to have at least one digit before the decimal point.
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.