Default an issue's due date to the assigned version's due date [Includes Patch]
|Assignee:||Eric Davis||% Done:|
I wasn't sure where to go with this one, as I've included a patch with a possible implementation, but it's more of a feature request as I'm not sure all aspects of this feature are desirable.
It seems to me that when an issue is assigned to a specific version and that version has a due date and that due date is out in the future at some point, the issue's due date should naturally default to when the specified version is due. Makes sense to me, at least.
I've attached two patches, one puts the functionality in the controller (less good), the other puts it in the Issue model's before_create callback (better).
Now, this could be more robust and check to see if the target version ever changes, and if it does apply the default. If that's the wish I could whip something like that up too - perhaps by utilizing the same sort of code found in Issue's before_save callback.
#1 Updated by Jean-Philippe Lang over 9 years ago
The problem with this default due date is that it won't be updated if you change the target version due date.
Note that, in current trunk, issues with no due date but with a target version automatically show up in the gantt chart with the same due date as the version (see r1455).
#2 Updated by Brian Terlson over 9 years ago
Ahh, very true, very true, and due dates do change frequently. r1455 does go a long way towards fixing the problem I was hoping to fix. Could this same logic be applied to the calendar so the tickets show up on the calendar when they are due? I could potentially make a patch for that behavior, although it may be that there is a compelling reason not to do that as well, such as too many items ending on the same day causing a fat calendar...
#3 Updated by Eric Davis over 9 years ago
I sometimes wonder if my private git repository is actually public.... :)
Earlier this month, I developed a plugin for a customer that will pretty much accomplish this (and more). It will set the issue's due date to the version's due date and will also update all of the related issues when a version's date is updated. It works 100% inside a plugin without requiring any modifications to the Redmine core.
I'll need to get authorization from my customer first but I shouldn't have any problems Open Sourcing it.
#4 Updated by Brian Terlson over 9 years ago
Yeah, I was just going to clone it locally but I figured eh, might as well fork. I might get into some heavier development at some point.
At any rate, glad to hear about the plugin! I think this is something that should be in core, though! For my usage, though, all I care about is that the calendar and the gantt chart display the issues as due at the time the version is due. If the actual due date field of the issue is null if it's not set, I'm fine by that ;)
#10 Updated by Ingolf Steinhardt about 8 years ago
it´s possible to add a second date like "target date" - this mean the date from planning schedule and the due date as the date at the issue is ready
if the due date <= target date: good :-)
if due date > target date: bad :-(
if due date >> target date: the deathsman is comming!
the compare can commbined with a alert system e.g. one day before due date == target date send Redmine a eMail...