Edgewall Software

Opened 9 years ago

Last modified 8 years ago

#12091 closed defect

Ticket ids in batch ticket notification should be sorted — at Initial Version

Reported by: Jun Omae Owned by:
Priority: normal Milestone: 1.0.10
Component: ticket system Version:
Severity: normal Keywords: notification
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Ticket ids in batch ticket notification are not sorted like this, though those are sorted in timeline view.

Batch modification to #886, #31, #53, #633, #918, #1084, #1113, #1890, #1962, ...

-- 
Tickets URL: <http://trac.edgewall.org/query?id=886%2C31%2C53%2C633%2C918%2C1084%2C1113%2C1890%2C1962%2C2035%2C2141%2C2463%2C3332%2C3386%2C3470%2C....
  • trac/ticket/notification.py

    diff --git a/trac/ticket/notification.py b/trac/ticket/notification.py
    index d34e3ee..35b334b 100644
    a b class BatchTicketNotifyEmail(NotifyEmail):  
    545545            self._notify(tickets, new_values, comment, action, author)
    546546
    547547    def _notify(self, tickets, new_values, comment, action, author):
     548        tickets = sorted(tickets)
    548549        self.tickets = tickets
    549550        self.reporter = ''
    550551        self.owner = ''
    551         changes_descr = '\n'.join(['%s to %s' % (prop, val)
    552                                    for (prop, val) in new_values.iteritems()])
    553         tickets_descr = ', '.join(['#%s' % t for t in tickets])
     552        changes_descr = '\n'.join('%s to %s' % (prop, val)
     553                                  for (prop, val) in new_values.iteritems())
     554        tickets_descr = ', '.join('#%s' % t for t in tickets)
    554555        subject = self.format_subj(tickets_descr)
    555         link = self.env.abs_href.query(id=','.join([str(t) for t in tickets]))
     556        link = self.env.abs_href.query(id=','.join(str(t) for t in tickets))
    556557        self.data.update({
    557558            'tickets_descr': tickets_descr,
    558559            'changes_descr': changes_descr,

Another suggestions for batch ticket notification mail:

  • Add unit tests. It doesn't seem to be no unit tests.
  • Add Message-ID header. Currently, SMTP server probably adds the header.

Change History (0)

Note: See TracTickets for help on using tickets.