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 over 9 years ago
- Related to Feature #20382: Date Custom Field Defaut Value added
Updated by Mizuki ISHIKAWA almost 8 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 almost 8 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 about 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 2 months 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.

Updated by Go MAEDA 3 days ago
I have created a new patch that supersedes the patch suggested in the previous note.
Feature #44129: Allow relative default values for date format custom fields
Instead of supporting only "Today" as a special default value, the new patch allows administrators to configure a date offset relative to the current date (for example, 0 for today, 7 for one week from today, or -3 for three days ago).
This provides a more flexible solution while still covering the original use case.
Updated by Go MAEDA 3 days ago
- Related to Feature #44129: Allow relative default values for date format custom fields added
Updated by Go MAEDA about 18 hours ago
- Target version deleted (
Candidate for next minor release)