Behaviour - Incompatibility when using setRequired and setFormValue
*This issue has moved*
This issue has been moved permanently to Adaptavist's Product Support JIRA instance.
All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.
The case is somewhat complex, I'll try to be clear.
I have 1 behaviour.
On a workflow transitions screen:
On FieldA in a serverside script, I set a default value for FieldX (FieldX.setFormValue(...) )
On FieldA in the same serverside script, I set FieldX = required (=> FieldX.setRequired(true) )
The FieldX is required (in the UI, I can see the red asterix next to the field name), and has a default value set (in the UI I can see the value in the field). Next I click the "Transition" button, I get an error message for fieldX :
"You must enter a value for this field"
It seems the "required" validation does not see (yet ?) the value set???
When before saving I just click with the mouse pointer in the fieldX (it gets focus), and then click the Transition button, everything goes fine.
Hope this is clear
P.S. I reported this issue already on Jira 6.1 and the old behaviours plugin!
Interesting! Indeed I have this code (script) hooked to several custom fields. I did not try (yet) to hook it to one field only.
However, my code must be hooked to several fields as changes to each of these fields should trigger the changed behavior... The code is executed too when the form is opened, and at that time the code is executed only once (as I see from the logging I added). Even in the case where my code is executed only once (as far as I see), I have the error...
I had exactly the same problem until I've rechecked my code and found that the strange behaviour was generated by a duplication of my code that was setting the value and the field as "required".
The duplicated code was hooked to two different custom fields in the same screen, so the double call was called probably generating some sort of confusion. I've removed the duplicated code and the problem disappeared.