Changes between Version 23 and Version 24 of WorkflowNotificationPlugin


Ignore:
Timestamp:
May 18, 2017, 2:01:02 PM (7 years ago)
Author:
ethan.jucovy@…
Comment:

Clarify watchful_user example, add "emailing all commenters" feature

Legend:

Unmodified
Added
Removed
Modified
  • WorkflowNotificationPlugin

    v23 v24  
    137137ticket_changed = *
    138138ticket_changed.body = View the ticket here: ${link}
    139 ticket_changed.recipients = watchful_user, another_watchful_user
     139ticket_changed.recipients = username, another_username
    140140ticket_changed.subject = Ticket ${ticket.id} has changed!
    141141}}}
     
    183183Meanwhile, if there are any newlines whatsoever in your `.subject` configuration, the plugin will replace them with spaces. This ensures that your email will have a valid subject (email subjects cannot contain newlines).
    184184
     185
     186=== Emailing all commenters on a ticket
     187
     188You can access a list of all users who have participated on a ticket (leaving
     189a comment, changing a field value) as well as the actions they took with the
     190variable `change_history`. This will contain a list of dicts, each with an
     191"author" key, as well as "field", "oldvalue", "newvalue", and "time", ordered
     192from oldest to newest.
     193
     194This can be used to construct a recipient list for everyone who has left a comment
     195on a ticket:
     196
     197{{{#!ini
     198[ticket-workflow-notifications]
     199ticket_changed = *
     200ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous' and i['field'] == 'comment' and i['newvalue'])))}
     201}}}
     202
     203Or you can email everyone who has ever participated on the ticket at all:
     204{{{#!ini
     205[ticket-workflow-notifications]
     206ticket_changed = *
     207ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous')))}
     208}}}
     209
     210Or you can email everyone who has ever updated a particular field on the ticket:
     211
     212{{{#!ini
     213[ticket-workflow-notifications]
     214ticket_changed = *
     215ticket_changed.recipients = ${','.join(list(set(i['author'] for i in change_history if i['author'] != 'anonymous' and i['field'] == 'milestone')))}
     216}}}
     217
     218This can also be used in the email subject, body, and condition templates.
     219
    185220== Recent Changes
    186221