It's all about the answers!

Ask a question

How to prevent Work Item summary from including the character "?


Rachel Biderman (42611) | asked Mar 21 '14, 3:10 a.m.
 We want some special characters not to be allowed - i was able to define a validation script using Regex.
When testing in the process template: "Try sample text" it all works fine.
Any string with " is marked as invalid.
But when i actually give a work item summary value with quotes (") it allows to save and no issue.

All other chars i prevented work fine and are not allowed.
I don't really understand why quotes is working in test sample but not in actual summary.
Am i missing anything?

The regex i used is: ^[^<>'\"/`@#:\\,]*$
Thanks

2 answers



permanent link
Ralph Schoon (63.1k33645) | answered Mar 21 '14, 4:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Did you configure the Attribute Validation Advisor and set the Severity to Error?

Comments
Rachel Biderman commented Mar 21 '14, 8:22 a.m.

Yes, of course I did.

Otherwise non of the other character restriction would work.
The issue seems to be only with quotes, although as I mentioned in the validation condition configuration section, when I test sample with quotes is says it is invalid.
 


Ralph Schoon commented Mar 21 '14, 8:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I hope someone with a better grasp on regexp comes up with an idea.


Rachel Biderman commented Mar 22 '14, 2:48 p.m. | edited Mar 22 '14, 3:00 p.m.

It seems my regular expression is correct

but when it is stored in the process configuration - it translates the quotes from:
\" to &quot which is the one used to validate the summary and that is why it is not working.
it is the same issue with the characters: < and > which are translated as well to:
&lt and &gt.


Rachel Biderman commented Mar 22 '14, 3:00 p.m.

sorry, i meant < > (not rectangle brackets which are working ok []) 


sam detweiler commented Mar 22 '14, 6:28 p.m. | edited Mar 22 '14, 6:34 p.m.

use the hex  values instead of the text values , \x3c = < and \x3e = > , \x22 = double quote


Ralph Schoon commented Mar 24 '14, 3:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This is odd.I would consider this behavior problematic. I think you should open a PMR. If there is a need to translate the data to store it, I think thins kind of translation should be done correctly while saving.

showing 5 of 6 show 1 more comments

permanent link
Rachel Biderman (42611) | answered Apr 07 '14, 3:25 p.m.
 I got an answer from IBM:
They suggested i use the chars i do allow rather than the ones i don't.
It is not trivial listing all allowed ones, in oppose to the ones i don't - but it solved the problem.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.