Edgewall Software
Modify

Opened 9 years ago

Closed 8 years ago

Last modified 5 years ago

#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. changes is the dictionary returned from Ticket.get_change.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

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 Ryan J Ollos, 9 years ago

Description: modified (diff)
Keywords: ticket._old subject_template removed
Milestone: 1.2
Owner: set to Ryan J Ollos
Status: newassigned

comment:2 by Ryan J Ollos, 9 years ago

I'm unsure what the best approach is to fix the issue. Should we just copy the ticket object before calling save_changes and pass the copy to TicketNotifyEmail.notify?

comment:3 by Ryan J Ollos, 9 years ago

Milestone: 1.21.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.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 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).

Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Ryan J Ollos, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [14924].

comment:6 by Tim Pohlmann, 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?

in reply to:  6 comment:7 by Christian Boos, 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 Ryan J Ollos, 5 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.