Attribute validation is not working - please help
Hello,
I am trying to use condition - validator approach for working with required attributes in my application. In condition, I am using check for state and action to set attributes as required and this is working fine. In validator, I am checking if the field value is unassigned or blank, and in that case, I am throwing an error message
The issue is, in spite of throwing this error message, the defect is being saved to next state.
I have also added the pre-condition of attribute validation to Save Work Item (server) for Everyone. I am configuring Operation Behavior section of Team Configuration.
Please help to resolve this situation. I really appreciate your advice.
|
Accepted answer
I found an issue in my environment and after resolving that, attribute validation is working fine.
There was an empty script which was showing errors in the console log. I removed it from Links. Now, the work item is not saved with validation errors. Ralph Schoon selected this answer as the correct answer
|
6 other answers
I am on RTC Version 5.0.1 and its all fine here.
|
|
Hello Ralph,
Thanks for spending time to debug this issue. First thing I did is copied your script and configured Description attribute with this validator and checked. The work item is saved, even if there a validation error on the description. So, pre-condition is the problem for me. That is where I am going wrong. Could you please let me know the steps you followed to enable the pre-condition in 5.0.1 Alejandro, You can also try this basic script in your environment and see if it works for you. |
RTC 5.01 here, same problem, I have the validator working properly, I have the attribute validation precondition, the validation error message is displayed but workitem can be saved despite of the invalid field, I have logged bug already on this aspect
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=337340 Comments
Ralph Schoon
commented Mar 06 '15, 2:49 a.m.
| edited Mar 06 '15, 2:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I created this basic script:
/*********** * Licensed Materials - Property of IBM * (c) Copyright IBM Corporation 2011. All Rights Reserved. * * Note to U.S. Government Users Restricted Rights: Then I configured the attribute (description) and the operational behavior. It works nicely for me in 5.0.1. So I have to assume you do something wrong. |
Hello, I have the same problem.
In the validator, I am throwing an error message like - return new Status(Severity["ERROR"], message); The validator is firing correctly and on error, I am able to see a red cross mark at the attribute to which I have attached the validator. On mouse over that cross mark, I can see right eror message. The issue is, in spite of throwing this error message, the work item is being saved to next state. I have also added the pre-condition of attribute validation to Save Work Item (server) for Everyone. I am configuring Operation Behavior section of Team Configuration.RTC Version: 5.0.1 |
Ralph Schoon (63.5k●3●36●46)
| answered Feb 20 '14, 2:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
We described how this works here: https://jazz.net/library/article/1093 (Lab 4 and 5)
From your description it sounds as if everything is set up correctly and should work.I think I remember there were issues with certain versions of RTC where the save was not blocked. Comments
Mahasweta Bagchi
commented Feb 20 '14, 2:58 a.m.
Hello Sir, Thanks a lot for your guidance. RTC version for both my server and client is 4.0.5. Can the issue be associated with this particular version? Please advise. I just tried a simple regular expression validator on 4.0.5 on the description field.
I tried with a script and the save was not prevented.
Well, after playing around with it, closing the client and web session, and retrying, it works with a script too.
|
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.