Opened 18 years ago
Closed 11 years ago
#4582 closed defect (fixed)
Renaming a milestone doesn't update ticket history
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | roadmap | Version: | 0.10 |
Severity: | normal | Keywords: | tracobject datamodel milestone |
Cc: | itamarost@… | Branch: | |
Release Notes: |
Ticket change history is updated when renaming a milestone. |
||
API Changes: | |||
Internal Changes: |
Description
If you rename a milestone the milestone on associated tickets is updated to reflect the change. However in the ticket history, where it says 'milestone set to x' or 'milestone changed from x to y', the milestone name hasn't been updated. Only a minor issue but still a little irritating.
Attachments (0)
Change History (12)
comment:1 by , 18 years ago
Keywords: | tracobject datamodel added |
---|---|
Milestone: | → 0.12 |
comment:4 by , 14 years ago
See #5658 for the same issue when re-targeting tickets on milestone completion.
comment:5 by , 14 years ago
Cc: | added |
---|
comment:6 by , 12 years ago
I investigated this briefly as a possible follow-on to #5658 if the patch is accepted there. It looks like we'd want to add an author
parameter to the update
method. The delete
method already has an author
parameter. We'd have to decide whether notifications should be sent. I'd lean towards no notifications.
-
trac-trunk/trac/ticket/model.py
1048 1048 for listener in TicketSystem(self.env).milestone_change_listeners: 1049 1049 listener.milestone_created(self) 1050 1050 1051 def update(self, db=None ):1051 def update(self, db=None, author=None): 1052 1052 """Update the milestone. 1053 1053 1054 1054 :since 1.0: the `db` parameter is no longer needed and will be removed … … 1072 1072 # Update milestone field in tickets 1073 1073 self.env.log.info("Updating milestone field of all tickets " 1074 1074 "associated with milestone '%s'", self.name) 1075 when = datetime.now(utc) 1076 comment = _("Milestone renamed.") 1077 for id, in db("SELECT id FROM ticket WHERE milestone=%s", (old_name,)): 1078 t = Ticket(self.env, int(id)) 1079 t['milestone'] = self.name 1080 t.save_changes(author, comment, when) 1075 1081 db("UPDATE ticket SET milestone=%s WHERE milestone=%s", 1076 1082 (self.name, old_name)) 1077 1083 TicketSystem(self.env).reset_ticket_fields() -
trac-trunk/trac/ticket/admin.py
268 268 _('Invalid Completion Date')) 269 269 mil.description = req.args.get('description', '') 270 270 try: 271 mil.update( )271 mil.update(req.authname) 272 272 except self.env.db_exc.IntegrityError: 273 273 raise TracError(_('The milestone "%(name)s" already ' 274 274 'exists.', name=name))
comment:7 by , 12 years ago
Milestone: | next-major-releases → 1.0.2 |
---|
comment:8 by , 12 years ago
Is the patch in comment:6 the one to be reviewed or did you plan an update?
comment:9 by , 12 years ago
Cc: | added |
---|
Some updates might be needed after #5658 is integrated, and I also had some questions in comment:6, but I felt like the patch captured the essential changes that needed to be made.
Another option is that I could combine the two patches, so just let me know what is easiest to handle on your end. Either way, I'm around and have time to commit to furthering the patches, so I can follow-up with a new patch soon, or within a few days of #5658 being integrated.
comment:10 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:11 by , 11 years ago
Cc: | removed |
---|---|
Keywords: | milestone added |
comment:12 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
See comment:50:ticket:5658 for a description of the changes.
This is an example of batch ticket change. #525 talks mainly about the UI for this, but we should also consider the problem from the API side.
This is even an example of a "cross resource" change set, as renaming a milestone also triggers a change in the milestone property of all the related tickets.