#12091 closed defect (fixed)
Ticket ids in batch ticket notification should be sorted
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.10 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | notification |
Cc: | Branch: | ||
Release Notes: |
|
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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): 545 545 self._notify(tickets, new_values, comment, action, author) 546 546 547 547 def _notify(self, tickets, new_values, comment, action, author): 548 tickets = sorted(tickets) 548 549 self.tickets = tickets 549 550 self.reporter = '' 550 551 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) 554 555 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)) 556 557 self.data.update({ 557 558 'tickets_descr': tickets_descr, 558 559 'changes_descr': changes_descr,
Another suggestions for batch ticket notification mail:
- Add unit tests. It seem to be no unit tests.
- Add
Message-ID
header. Currently, SMTP server probably adds the header.
Attachments (1)
Change History (12)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Owner: | set to |
Status: | new → assigned |
follow-ups: 3 5 comment:2 by , 10 years ago
by , 10 years ago
Attachment: | batchmod-event-timeline.png added |
---|
comment:3 by , 10 years ago
Shouldn't the order be the one that was used in the batch modification view? If you want to sort by Id there, great, but there might be other options (prio?).
It is hard to compare ticket ids in batchmod notification and batchmod events in timeline view to me, because ticket ids in the batchmod notification are unsorted. See batchmod-event-timeline.png.
I think order of ticket ids should be consistent in the batchmod notification and timeline view.
comment:4 by , 10 years ago
Sure, they should better be consistent, I was just questioning the pertinence of always sorting them by Id, as elsewhere we have the possibility to produce list of tickets in a given sequence:
[[TicketQuery(severity=critical,status=!closed,order=modified,desc=true,format=compact)]]
#1, #4431, #221, #5648, #1242, #10606, #4298, #1132, #1465, #2465
Probably not that important in the batch modification case, as the order chosen in that view is not as significant as when specified explicitly in a TicketQuery, so do as you prefer, I just wanted to mention that possible alternative ;-)
comment:5 by , 10 years ago
Replying to cboos:
Shouldn't the order be the one that was used in the batch modification view? If you want to sort by Id there, great, but there might be other options (prio?).
In addition to the consistency argument, both views have a link to a custom query view with the tickets sorted by priority:
timeline:2015-05-26T11:59-0700
Batch modification to #4431, #1024, #4790, #8140, #1240, #1936, #3307, #379= 4, #3895, #3970, #4140, #4848, #5059, #6630, #7721, #7728, #8686, #9251, #9= 688, #10312, #10523, #10734, #2717, #4439, #2064, #10075 by rjollos: Action: unassign -- Tickets URL: <http://trac.edgewall.org/query?id=3D4431%2C1024%2C4790%2C8140= %2C1240%2C1936%2C3307%2C3794%2C3895%2C3970%2C4140%2C4848%2C5059%2C6630%2C77= 21%2C7728%2C8686%2C9251%2C9688%2C10312%2C10523%2C10734%2C2717%2C4439%2C2064= %2C10075> The Trac Project <http://trac.edgewall.org/> The Trac Project
I think it would be reasonable that the custom query view be the one used in batch modification. I'm not sure that would be such an easy change to make though.
comment:6 by , 9 years ago
Proposed changes in jomae.git@t12091. After the changes, the tickets' id with sorted by priority are shown in query link of timeline view and batch modify notification.
comment:7 by , 9 years ago
Milestone: | 1.0.7 → 1.0.8 |
---|
Retargeting to milestone:1.0.8 because the changes aren't small.
comment:8 by , 9 years ago
Milestone: | 1.0.8 → 1.0.9 |
---|
comment:9 by , 9 years ago
Milestone: | 1.0.9 → 1.0.10 |
---|
Moving tickets that appear to be uncompleted for milestone:1.0.9. Please move back to milestone:1.0.9 if the ticket can be completed by 2015-09-07 18:00 UTC.
comment:10 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:11 by , 9 years ago
I rebased the changes for #11901 after this commit: [a982d22f/rjollos.git]. I added sort_tickets_by_priority
to trac.ticket.model
, and it's utilized in TicketFormatter._format_subj_batchmodify
and TicketFormatter._format_plaintext_batchmodify
. I couldn't see a way to avoid calling the function twice, but maybe there's a better solution.
Shouldn't the order be the one that was used in the batch modification view? If you want to sort by Id there, great, but there might be other options (prio?).