I want to capture just the month and year from a date picker field. For example, I click on the field, in a date picker choose, 2/20/2019, and the field then stores Feb 2019.
As an alternative, I could leave that field as a date picker, then do a separate calculated field to get the MMM YYYY format.
I got this far...
def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Target Delivery Date")
def tcDate = issue.getCustomFieldValue(cf)
return new SimpleDateFormat("MMMM, yyyy", Locale.US).format(new Date(tcDate));
But get an error
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.Date(java.sql.Timestamp)
Thanks for any help.
Shipping new code shoul...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events