Changes between Version 5 and Version 6 of WorkflowNotificationPlugin


Ignore:
Timestamp:
Dec 12, 2012, 1:52:37 AM (11 years ago)
Author:
ejucovy
Comment:

conditional notifications

Legend:

Unmodified
Added
Removed
Modified
  • WorkflowNotificationPlugin

    v5 v6  
    137137}}}
    138138
     139=== Conditional Notifications ===
     140
     141In addition to the required configuration fields described above, you can
     142optionally include a `.condition` definition for a notification.  If provided,
     143this should be a Genshi text template which evaluates to the value True if and
     144only if the notification should be sent.  If the template evaluates to any value
     145other than True, the notification will be skipped. 
     146
     147If no `.condition` is provided, then the notification will be sent unconditionally
     148when it is triggered.
     149
     150One use for this would be sending a notification when a ticket is resolved 'fixed':
     151
     152{{{
     153[ticket-workflow-notifications]
     154when_fixed = resolve
     155when_fixed.body = Ticket $ticket.id has been fixed!  View it here: $link
     156when_fixed.subject = Ticket $ticket.id is fixed!
     157when_fixed.recipients = $ticket.cc
     158when_fixed.condition = ${ticket.resolution == 'fixed'}
     159}}}
     160
     161But you could get as complex as you want with this feature:
     162
     163{{{
     164magic_word.condition = ${'notifyme' in change.comment and change.author != ticket.reporter}
     165}}}
     166
    139167==== Notifications for new tickets ====
    140168