Modify

Opened 4 years ago

Last modified 4 months ago

#11621 accepted enhancement

${ticket.commenters} field to include all previous commenters as recipients

Reported by: michael.snook@… Owned by: ejucovy
Priority: normal Component: WorkflowNotificationPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

For our internal helpdesk at work, we have staffers interact with a HelpDesk trac instance, but a lot of our correspondence happens via email threads. We'd like to make sure that staffers who comment on the ticket are automatically added to that email thread, so a ${ticket.commenters} feature would be helpful.

I should note that because we also include ${tickets.cc} this is basically the same, for us, as automatically adding someone to cc whenever they comment.

Attachments (0)

Change History (4)

comment:1 Changed 12 months ago by robert.bostedt@…

I fully endorse this idea - 3 years on as still as relevant. I find no other good way of getting updates from tickets that i've written in but not own or reported. Unless turning ALWAYS_NOTIFY_UPDATER on, but then i cannot be selective on what updates to receive

comment:2 Changed 5 months ago by ejucovy

Status: newaccepted

comment:3 Changed 5 months ago by ejucovy

In fab5c00 I've added a change_history variable that can be used for this, as well as more obscure use cases.

I'm a little bit tempted to add a commenters variable too just to make it easier to spell, but I like the flexibility here since "all commenters" might have different meanings to different people. Curious what others think.

Emailing all commenters on a ticket

You can access a list of all users who have participated on a ticket (leaving a comment, changing a field value) as well as the actions they took with the variable change_history. This will contain a list of dicts, each with an "author" key, as well as "field", "oldvalue", "newvalue", and "time", ordered from oldest to newest.

This can be used to construct a recipient list for everyone who has left a comment on a ticket:

[ticket-workflow-notifications]
ticket_changed = *
ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous' and i['field'] == 'comment' and i['newvalue'])))}

Or you can email everyone who has ever participated on the ticket at all:

[ticket-workflow-notifications]
ticket_changed = *
ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous')))}

Or you can email everyone who has ever updated a particular field on the ticket:

[ticket-workflow-notifications]
ticket_changed = *
ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous' and i['field'] == 'milestone')))}

This can also be used in the email subject, body, and condition templates.

comment:4 Changed 4 months ago by robert.bostedt@…

Great progress! Looking forward to new release.

I like the idea of easily access recipient list for all those that left a comment on the ticket in a "commenters" variable.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as accepted The owner will remain ejucovy.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.