Feature #25035
openOption to set current date as a default value of date format custom field
Description
It would be very useful if we can set current date to a date format custom field when we create a new issue.
Related forum post:

Files
Related issues
Updated by Go MAEDA about 9 years ago
- Related to Feature #20382: Date Custom Field Defaut Value added
Updated by Mizuki ISHIKAWA over 7 years ago
- File add_current_date.patch add_current_date.patch added
I wrote a patch to realize this feature.
Implementation for setting the default value to current date may not be the best way.
Feedback is welcome.
Updated by Go MAEDA over 7 years ago
- Target version set to Candidate for next minor release
Thank you for sharing the patch. The patch looks fine.
Updated by Go MAEDA over 7 years ago
- Target version changed from Candidate for next minor release to 4.1.0
What do you all think about this patch? Feedbacks welcome.
Updated by Jean-Philippe Lang almost 7 years ago
- Target version changed from 4.1.0 to Candidate for next minor release
Mizuki ISHIKAWA wrote:
I wrote a patch to realize this feature.
Implementation for setting the default value to current date may not be the best way.
Feedback is welcome.
Thanks for your patch. It's a usefull feature but this patch has the side effect that it makes the string "current_date" a valid value for date custom fields. I think we need a different approach.
Updated by sosogh sosogh almost 3 years ago
Jean-Philippe Lang wrote in #note-5:
it makes the string "current_date" a valid value for date custom fields.
Is it a serious problem ? Under what conditon , will it happen ?
I am considering using this patch
Updated by Go MAEDA 4 days ago
- File clipboard-202603211853-ycvda.png clipboard-202603211853-ycvda.png added
- File 0001-Add-current-date-option-for-date-format-custom-field.patch 0001-Add-current-date-option-for-date-format-custom-field.patch added
I wrote a new patch that adds a "Today" option using a different implementation approach.
As noted in #note-5, storing a literal string such as current_date in the default_value column would be problematic. To avoid that, this patch stores the selection mode separately in format_store as default_value_mode, with fixed_date and current_date as its possible values.
With this approach, administrators can choose either a fixed date or Today as the default value for date custom fields without storing a special token in the default_value column.
