[ticket-custom]
test = select
test.label = Test
test.options = |open|done
test.value =
tester = text
tester.label = Tester
tester.value =[autocomplete]
fields = tester
I managed to add custom fields for User roles
But most important we would need notifications based on Roles. That would mean a tester gets a notification if he was added to a Tester role.
I looked at AnnouncerPlugin which only has a very small set of static rules and does not support any custom fields. Then I looked at XMailPlugin (or called MailPlugin), that could create any SQL filter for mail notifications, but only SQL based. That could work, any other idea to have custom filter rules for mail notifications, user based and global ones by the administrator?
Actually the Announcer branch 0.11 already had a TicketCustomFieldSubscriber that did something similar.
https://trac-hacks.org/browser/announcerplugin/branches/0.11/announcerplugin/subscribers/ticket_custom.py
Trac 1.2's new notification system would allow you to write a small single-file plugin implementing INotificationSubscriber.
https://trac.edgewall.org/wiki/TracDev/Proposals/AdvancedNotification
https://trac.edgewall.org/wiki/TracDev/PluginDevelopment#Singlefileplugins
https://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.notification.api.INotificationSubscriber#Examples
If I understand you correctly you want notification subscriptions exactly like the CC field provides, but for a custom field.
So I think you could basically copy the component that implements the CC field notifications (CarbonCopySubscriber) and replace 'cc' by your custom field name.
https://trac.edgewall.org/browser/trunk/trac/ticket/notification.py?rev=15148&marks=712-759#L711
That could look something like this (untested):
Invalid SQL-String:
select id,summary from ticket where developer='Mo'
Any major migration issues with 1.0 to 1.2? I'll test on a snapshot anyway.
That could look something like this (untested):
...
Is that code already something that would work as a single-file plugin.py in ./plugins already?
Beside from that, a rule framework configurable on the user preferences would be preferable.
I'm not familiar with that plugin, but it's likely it won't work unchanged with Trac 1.2.
Could you explain a bit more what kind of flexibility you're looking for?
The single-file plugin subscriber actually adds a rule that can be configured in the user preferences (and / or by the site admin as overridable default).
The basics rules available by default look something like this:
https://trac.edgewall.org/attachment/wiki/TracDev/Proposals/AdvancedNotification/notification-subscription-prefs.png
Concerning the Trac 1.2 update. I got all plugins updated and working except these issue:
def description(self):
return "Ticket that I'm listed in as %s is modified" % self.field_name
I did not set email_address_resolvers, so having the default it should be set to SessionEmailResolver, according https://trac.edgewall.org/wiki/TracIni#notification-email_address_resolvers-option.
There is no other option.
When I was using AnnouncerPlugin on Trac 1.0.9 I had email_address_resolvers = SpecifiedEmailResolver,SessionEmailResolver,DefaultDomainEmailResolver.
Sorry, I don't fully understand your question.
SessionEmailResolver is the only one by default.
AccountManagerPlugin is not involved in this I think.
Possibly your problem is related to
https://trac.edgewall.org/ticket/12660?
All active IEmailAddressResolver components are always used in
Trac 1.2, even if not listed in email_address_resolvers.
(This will be fixed in Trac 1.2.1.)