Calculated Value that also allows for manual setting of field?
I have a Calculated Value script working when Status (state) changes to set a custom date field (Verified Date). We also want to be able to manually set this value to correctly set dates before this script existed. When I save the manually selected date in eclipse, the date returns to blank. I saw a comment in the wiki about making Calculated Values read only in the presentation, but are you actually prevented from making manual updates to fields with a script associated with them?
Accepted answer
Vince,
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.
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
One other answer
Vince,
It is easy to get a custom attribute's current value:
currentValue= workItem.getValue('attribute id');
Ex:
contactName = workItem.getValue('defect.mycustomAttribute');
But, as Ralph mentioned you have to return some value, or else the attribute's current value is erased.
I will play with exceptions to see if that works instead. Since I'm having problems with the shared HTML attr. "Summary" I would like something like this:
If type = defect then
return some-text
else
do-nothing
Comments
Vince Thyng
May 07 '14, 1:43 p.m.