Does a script based validator overwrite the precondition operation behaviour for attributes?
I have created a script to validate two date fields against each other where date 1 must be earlier then date 2. If they are OK you can proceed and save the WI.
But if they are not valid, you can still save the workitem - even though I have set the operation behaviour for Save WI and set these fields as Required attributes. Is there a reason why the operation behaviour allows saving even if the fields are invalid and thrown an error message? Here are the steps I completed to add the script to the attributes: 1. Created the attributes for the date fields. 2. Set the Save Work Item precondition for the fields in Operation Behaviour (Required attributes precondition.) 3. Created a script based validator. 4. Associated the JavaScript file to the attributes. 5. Made fields dependent on each other. |
One answer
Hi Sinead,
In step 2, you also need to add "Attribute Validation" precondition, with which all attribute values will be validated when they are saved on the server Please have a look the wiki https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Validators |
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.