I've found several discussions on this topic, but can't seem to get any to work. I have the below code implemented on my system and the 2 custom date fields are filled in, but my new field doesn't show up...
@Formula:
if (issue.get("customfield_10779")==null || issue.get("customfield_10652") == null)
return null;
return (issue.get("customfield_10779").getTime() - issue.get("customfield_10652").getTime()) / 1000 / 3600 / 24; -->
Some additional details/questions:
- JIRA Server
- Date Custom Fields are Date (not Date/Time)
- Using Custom Calculated Number Field
- Custom Calculated Number Field is added to project screen
Does the calculation happen automatically / on refresh? Or does it require a transition to take place?
Is there a way to easily check what's going on under the hood to see what JIRA thinks the fields are set to so that I can try to understand why the calculation isn't working?
UPDATE: It loos like the formula wasn't working because the initial fields were 'date picker' type instead of 'date/time picker' type. Is there any way to use just date? I can't find a good list of possible commands anywhere...