#6237 closed enhancement (fixed)
Email Changes in Ticket
Reported by: | Owned by: | Alexander von Bremen-Kühne | |
---|---|---|---|
Priority: | normal | Component: | TicketTeamDispatcherPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
This is in reference to ticket #6201 Please try making a ticketTeamdispatcher plugin send out notifications for subsequent changes done to the ticket to the Team selected.
This is because the point of having edit notifications being sent is that for example, 10 people on a team working on a ticket to solve...if subsequent notifcation arent sent, then unless each and everyone explicitly watches (watchlist plugin) or start working on it (worklog plugin), the ticket status remains unknown to them till the next time he checks on it. So upon closure by another member(with ticket_modify perm ofcourse), the other members could simply be working on an already closed ticket.
Also,if the Team needs to be changed, that is a new team to be assigned if the current team isnt capable..or as for corporate environments (ticket transferred between Onsite and Offshore members). In these cases, notifications for changes ALSO would be appreciated.
:) thnx
Attachments (0)
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Solution listed at #6201:
You just have to adjust 0.11/ttd/api.py and replace the Lines saying 'pass' with these two lines:
mail = SpecialTicketNotifyEmail(self.env) mail.notify(ticket)
comment:3 Changed 11 years ago by
I am currently working on an update that will allow configuring email notifications for creation, change and deletion of tickets. Once this is complete and I obtain permission to commit my changes, this issue will be resolved.
comment:4 Changed 11 years ago by
Add the ability to configure whether emails are sent on ticket creation, modification or deletion. These options are configured under the [ttd] section of trac.ini as follows:
email_on_create: Boolean (true|false), send email on ticket creation email_on_change: Boolean (true|false), send email on ticket modification email_on_delete: Boolean (true|false), send email on ticket deletion
For now these options will need to be entered manually on ticket install. Web admin entries and defaults will come later.
Diff of changes:
-
ttd/api.py
1 1 from trac.core import Component, implements 2 2 from trac.ticket.api import ITicketChangeListener 3 from datetime import datetime 4 from trac.util.datefmt import utc 3 5 4 6 #local 5 7 from notification import SpecialTicketNotifyEmail … … 8 10 implements(ITicketChangeListener) 9 11 10 12 def ticket_created(self, ticket): 11 mail = SpecialTicketNotifyEmail(self.env) 12 mail.notify(ticket) 13 do_mail = self.config.getbool('ttd', 'email_on_create') 14 if do_mail: 15 mail = SpecialTicketNotifyEmail(self.env) 16 mail.notify(ticket) 13 17 14 18 def ticket_changed(self, ticket, comment, author, old_values): 15 pass 19 do_mail = self.config.getbool('ttd', 'email_on_change') 20 if do_mail: 21 now = datetime.now(utc) 22 mail = SpecialTicketNotifyEmail(self.env) 23 mail.notify(ticket, False, now) 16 24 17 25 def ticket_deleted(self, ticket): 18 pass 26 do_mail = self.config.getbool('ttd', 'email_on_delete') 27 if do_mail: 28 now = datetime.now(utc) 29 mail = SpecialTicketNotifyEmail(self.env) 30 mail.notify(ticket, False, now) 31
I can commit this if I can get permission to do so (I get a 403 Forbidden when I attempt to do so at the moment)
Edit: Updated diff.
comment:6 Changed 11 years ago by
The basics of the patch are okay, but there are some subtle issue:
- When adding options to a plugin, the
Option
class or subclasses such asBoolOption
should be used: browser:/branches/1.0-stable/trac/config.py@12430:641#L641 - I used notify rather than email in the option names, since it seems to be more consistent with the Trac nomenclature.
- I used
team-dispatcher
as the section name sincettd
isn't very descriptive. - The ticket changes were not being included in the notification. The
modtime
is used to lookup the changelog entries, so we need to use the ticket's changetime (which will equal themodtime
of the change that we are sending the notification for). - The email notification on ticket delete did not provide any indication that the ticket was being deleted, so I appended (delete) to the Summary (which becomes the subject of the email).
Please test out the latest and report any issues you find.
Side note: Eventually, the AnnouncerPlugin (the core of which is being integrated to Trac for release 1.2), should provide equivalent functionality to this plugin through it's subscriber mechanism.
comment:7 Changed 11 years ago by
Just tested the new functionality, it looks great. Emails are being sent on ticket modification and deletion once the plugin is configured. I was wondering why the comments weren't showing up, thanks for the info on that function.
And thanks for the tips on plugin development, Trac hacks are somewhat new to me :)
Seconded, I am running into this issue now as well.