I currently use the Validation Rule : ^[a-zA-Z0-9]*$
I need to restrict quotation marks for a particular field as it errors out when I try to upload it into JIRA Summary field.
How do I add quotation marks "" and Parenthesis () to the validation rule? Or any other special character that can be restricted?
When you map the field to your Jira field use the escapeJSON function to handle ANY character that may break your mapping
[entry.field_name.escapeJSON]
As not only the quotation can break it
should I still place the validation rules or no need if i place escapeJSON tag?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are mapping this to Jira summary field, right?
So, you do that in the JSON mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes so i've got a Summary input field in confiform and that gets translated to JIRA Title.
But the title doesn't allow quotation marks, thus I need to input restriction.
I currently placed restriction as validation rule so as not to allow submission, but it still allows quotation marks on submission. so I wanted to also add restriction to quotation marks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cannot tell much about the regular expression, but was trying to help you to make the Jira mapping more robust and work eve if someone puts the quotation or anything else harmful in the field's value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No idea about confiforms, but as far as regular expressions go, quotation marks are not reserved characters.
Generally (depending on the regex implementation/type) brackets are and should be escaped. I have yet to see any other approach to escaping in regex than backslashes.
So to put this into example:
^[a-z]+([0-9])$
This will match a string that begins with at least one lowercase a-z character, followed by and ending with a single digit. Here the brackets are used for grouping purposes, because you could then get the digit by referring to the brackets, such as $1
^[a-z]+\([0-9]\)$
With the brackets escaped, this will match a string that begins with at least one lowercase a-z character, followed by (, followed by a single digit, followed by and ending with ).
The regex in this case is probably implementation of https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html which contains more details.
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.