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
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 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.
I have only one team area in my project area.
Please help to resolve this situation. I really appreciate your advice.
Accepted answer
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.
6 other answers
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
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
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=337340
Comments
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.