You mean the first (non-empty) value ever set on a field? There is no such built-in custom field type, but you can achieve the same with a Calculated (scripted) Date/time field with the following formula:
def duedateHistory = issue.getFieldHistory("duedate")
if (duedateHistory)
return new java.text.SimpleDateFormat("yyyy-MM-dd").parse(duedateHistory.first().from ?: duedateHistory.first().to)
return issue.get("duedate")
Yeah the scenario I have is that I have a custom date field called "Goal Date" that is going to be set and changed from time to time. I want to be able preserve the first non-empty value as another custom field called Original Due Date. That way I can perform any calculations and evaluations on "Goal Date" but I also have the original due date that was set for reference. Does the above do that? Am I creating the goal date as the calculated date time field or the original due date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above does that but with the Due Date field. You need to replace "duedate" with your custom field's name ("Goal Date") or ID ("customfield_xxxxx" - you can figure out what it is from the "Issue Fields" help tab below the formula editor).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
David, seems like it is almost working, but all of the dates are showing up a day before. So if it was set to September 8, 2019, it is showing as September 7, 2019. Also, is it possible to not show the time and only the date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out the date formatting so that it doesn't show the time. Now the only thing I need to figure out is why it is showing the day before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reason why it's showing the day before is because the calculated field is handling the value, during formatting, in the system time zone instead of your own time zone. This is a bug (https://innovalog.atlassian.net/browse/JMCF-316) and it will be fixed in the next version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.