Opened 9 years ago
Last modified 4 years ago
#12205 closed defect
ticket._old not available in ticket_subject_template — at Version 4
Reported by: | Tim Pohlmann | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.1 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Ticket changes can be used to format the subject template. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
The previous ticket values are not available in the notification system. When a ticket is created, ticket.insert
is called. When a ticket is updated, ticket.save_changes
is called. Both of those function reset ticket._old
.
(see SO:32473999)
Change History (4)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Keywords: | ticket._old subject_template removed |
Milestone: | → 1.2 |
Owner: | set to |
Status: | new → assigned |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Milestone: | 1.2 → 1.3.1 |
---|
The new notification system provides a more elegant way to fix the issue. We can pass to the template the ticket changes contained in the event.changes
attribute. An "old" value can then be accessed through, for example: changes.fields['status']['old]
. The implementation is much easier following the refactoring of the notification code that has been prepared in #11901. Proposed changes in [970cec69/rjollos.git]. Included are test cases based on the request in SO:32473999. I used the request as an example of a sufficiently complex ticket_subject_template
.
comment:4 by , 9 years ago
Release Notes: | modified (diff) |
---|
DONE Update documentation after changes are committed to trunk: wiki:1.3/TracNotification#Customizingthee-mailsubject (DONE in 1.3/TracNotification@2).
I'm unsure what the best approach is to fix the issue. Should we just copy the
ticket
object before callingsave_changes
and pass the copy toTicketNotifyEmail.notify
?