It's all about the answers!

Ask a question

Does a script based validator overwrite the precondition operation behaviour for attributes?


Sinead White (11) | asked Dec 09 '14, 8:53 a.m.
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



permanent link
Lily Wang (4.9k714) | answered Dec 10 '14, 12:57 a.m.
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


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.