Edgewall Software

Opened 17 years ago

Closed 11 years ago

#4582 closed defect (fixed)

Renaming a milestone doesn't update ticket history

Reported by: sdyson@… 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:


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 Christian Boos, 17 years ago

Keywords: tracobject datamodel added
Milestone: 0.12

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.

comment:2 by osimons, 16 years ago

#5897 closed as duplicate.

comment:3 by Christian Boos, 15 years ago

See also closely related #5658.

comment:4 by Remy Blank, 14 years ago

See #5658 for the same issue when re-targeting tickets on milestone completion.

comment:5 by Itamar Ostricher, 14 years ago

Cc: itamarost@… added

comment:6 by Ryan J Ollos <ryan.j.ollos@…>, 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

    10481048        for listener in TicketSystem(self.env).milestone_change_listeners:
    10491049            listener.milestone_created(self)
    1051     def update(self, db=None):
     1051    def update(self, db=None, author=None):
    10521052        """Update the milestone.
    10541054        :since 1.0: the `db` parameter is no longer needed and will be removed
    10721072                # Update milestone field in tickets
    10731073                self.env.log.info("Updating milestone field of all tickets "
    10741074                                  "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)
    10751081                db("UPDATE ticket SET milestone=%s WHERE milestone=%s",
    10761082                   (self.name, old_name))
    10771083                TicketSystem(self.env).reset_ticket_fields()
  • trac-trunk/trac/ticket/admin.py

    268268                                            _('Invalid Completion Date'))
    269269                    mil.description = req.args.get('description', '')
    270270                    try:
    271                         mil.update()
     271                        mil.update(req.authname)
    272272                    except self.env.db_exc.IntegrityError:
    273273                        raise TracError(_('The milestone "%(name)s" already '
    274274                                          'exists.', name=name))
Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:7 by Christian Boos, 11 years ago

Milestone: next-major-releases1.0.2

comment:8 by Christian Boos, 11 years ago

Is the patch in comment:6 the one to be reviewed or did you plan an update?

comment:9 by Ryan J Ollos <ryan.j.ollos@…>, 11 years ago

Cc: ryan.j.ollos@… 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 Ryan J Ollos, 11 years ago

Owner: changed from Christopher Lenz to Ryan J Ollos
Status: newassigned

comment:11 by Ryan J Ollos, 11 years ago

Cc: ryan.j.ollos@… removed
Keywords: milestone added

comment:12 by Ryan J Ollos, 11 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

See comment:50:ticket:5658 for a description of the changes.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.