#12205 closed defect (fixed)
ticket._old not available in ticket_subject_template
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 email 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)
Attachments (0)
Change History (8)
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).
follow-up: 7 comment:6 by , 8 years ago
I have a really hard time understanding the versioning for Trac. Is it possible to download an (unstable) version of Trac which includes this feature already?
comment:7 by , 8 years ago
Replying to Tim Pohlmann:
I have a really hard time understanding the versioning for Trac. Is it possible to download an (unstable) version of Trac which includes this feature already?
We'll have a 1.2 (stable) release "soon", and I think it makes sense to have a 1.3.1 release at about the same time. The fix for this ticket would then be in 1.3.1.
comment:8 by , 5 years ago
Release Notes: | modified (diff) |
---|
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
?