Calculated Value that also allows for manual setting of field?
Accepted answer
as far as I can tell, you are not required to make the attribute read only. However, every time the calculation script affecting this attribute you have to decide if you want to overwrite it. This is often not easy to do. As described in https://jazz.net/wiki/bin/view/Main/AttributeCustomization you can return the current value or a calculated value. You would have to make a decision somehow.
Please let us know if it works for you.
Comments
Thanks Ralph. I have my Calculated value setup to only run when there is a Staus (state) change, so I was surprised to see my manual change of the my custom date get reset immediately to blank when I saved. I am not expecting my script to be running at that point.
The bigger issue I have run in to is that I can't access my custom field from the Calculated Value js script, so I can't return the current value when the script runs. So as you mentioned, it will get blanked out anyway if the state change I am interested in doesn't meet my script's logic criteria.
One other answer
Comments
Thank you Henrik, this actually solves the problem have! For some reason I was thinking I needed to use the fields available with workItem.getValue(WorkItemAttributes.*). In my case 'defect.testdate' did not see it, but just 'testdate' did.
If you do test exception handling too, I would be curious of the results.
if ( Type == "defect" ) {
return "something";
throw 0;
Comments
Vince Thyng
May 07 '14, 1:43 p.m.<removed comment, it was unrelated>