I have created a new custom field type in my plugin. The new type is designed to contain time duration values similar to those supported by the worklogs (e.g. 3w 2d 1h).
The underlying DB value is store as a Double. The value stored is the number of seconds.
The transport object is a Long (so that it can for example be added to worklog values).
The display object is a String which is generated using a JiraDurationUtils object.
All of this seems to work fine except for one problem:
My velocity template for viewing the value uses $value to display the value on the screen. The value that I am seeing is the number of seconds rather than the formatted string.
My velocity template for editing also uses $value, but when I edit the issue I see the formatted string rather than the number of seconds.
Why do the two templates behave differently and how can I call a function from the view template to convert the value to a formatted string (I already have that function available in my custom field class) ?
I am using JIRA 4.3.3