It's all about the answers!

Ask a question

What is wrong with my Validator


Sivarajah Rajeswaran (15412) | asked May 26 '16, 11:22 p.m.
I created a validator called TimeSpent.
I entered a regular expression (\d*h)|(\d*m)|(\d*h[ \t]\d*m)
what the expression is meant to validate is that the user entere the value of Time Spent as :
3h OR 3m OR 3h<space>3m

When I test this using "Try the Regular Expression on sample Text" within the "Attribute Customisation" window and I enter 3h 3m no ettor(red cross) is shown BUT
when I create the WI and enter 3h 3m , the red cross appears

3 answers



permanent link
Ian Wark (79713553) | answered May 27 '16, 2:01 a.m.
 I can reproduce this issue on RTC 6.0.1. I have tried a few other options such as the below, but while they work in the sample section, they do not work in the work item itself.

(\d*h)|(\d*m)|(\d*h[ \t]{1}\d*m) 

Let me create a defect for it.

permanent link
Ian Wark (79713553) | answered May 27 '16, 2:22 a.m.
Here is the work item I created to track this issue:

Regular expression sample text behaves differently to work item validated text
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=392457

Comments
Sivarajah Rajeswaran commented May 27 '16, 9:36 p.m.

I don't have access to to save the defect WI you created so I am unable to attach screen shots


permanent link
Sivarajah Rajeswaran (15412) | answered May 27 '16, 9:43 p.m.
Hi Ian,

Even the "calculated values" feature does not seem to work, I have spent a week on trying to get it to work. The Java script does not seem to fire no matter what I do. Can you raise a defect for this too. Here is the link

https://jazz.net/forum/questions/222094/why-is-this-script-not-returning-any-calculated-value?utm_campaign=forum&utm_medium=email&utm_source=forum-new-comment&utm_content=forum-question

Comments
Ian Wark commented May 30 '16, 2:57 a.m.

This feature will work when all the stars are aligned. I made a suggestion in the other forum question, but essentially, you need to get some kind of message feedback at the beginning or else you may never have a basis for debugging. With your super pared down example, I would add console.log(); messages. If you are using Tomcat it may be easier to find the console.log messages. Note that there are times you need to check both the server and client to find the console.log messages.


Server: JazzTeamServer/server/tomcat/work/Catalina/localhost/ccm/eclipse/workspace/.metadata/.log
Eclipse client: client/eclipse/workspace/.metadata/.log

If you can manage to stop at a breakpoint (you may need to use an old version of a browser) then the below article gives good explanation for how to set up Javascript debug:

Debugging attribute customization scripts - an example

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.