Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#6612 closed defect (invalid)

'resolution' field undefined when sending notification mail

Reported by: j.vargas@… Owned by: Emmanuel Blot
Priority: high Milestone:
Component: notification Version: devel
Severity: major Keywords:
Cc: osimons Branch:
Release Notes:
API Changes:
Internal Changes:

Description

repro:

  1. enabled smtp notification
  2. created new ticket

expected:

notification mail should be sent

results:

error in trac log as follows:

2008-01-08 17:09:39,360 Trac[svn_fs] DEBUG: Subversion bindings imported
2008-01-08 17:09:39,535 Trac[__init__] ERROR: Failure sending notification on creation of ticket #7: "resolution" not defined
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r6363-py2.5.egg/trac/ticket/web_ui.py", line 920, in _do_create
    tn.notify(ticket, newticket=True)
  File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r6363-py2.5.egg/trac/ticket/notification.py", line 137, in notify
    subject = self.format_subj(summary)
  File "/usr/lib/python2.5/site-packages/Trac-0.11dev_r6363-py2.5.egg/trac/ticket/notification.py", line 223, in format_subj
    return template.generate(**data).render('text', encoding=None).strip()
  File "build/bdist.linux-i686/egg/genshi/core.py", line 172, in render
    return encode(generator, method=method, encoding=encoding)
  File "build/bdist.linux-i686/egg/genshi/output.py", line 45, in encode
    output = u''.join(list(iterator))
  File "build/bdist.linux-i686/egg/genshi/output.py", line 478, in __call__
    for event in stream:
  File "build/bdist.linux-i686/egg/genshi/core.py", line 273, in _ensure
    for event in stream:
  File "build/bdist.linux-i686/egg/genshi/template/base.py", line 496, in _exec
    for event in stream:
  File "build/bdist.linux-i686/egg/genshi/template/base.py", line 473, in _eval
    result = data.evaluate(ctxt)
  File "build/bdist.linux-i686/egg/genshi/template/eval.py", line 144, in evaluate
    return eval(self.code, _globals, {'data': data})
  File "<string>", line 1, in <Expression u'resolution'>
  File "build/bdist.linux-i686/egg/genshi/template/eval.py", line 269, in lookup_name
    val = cls.undefined(name)
  File "build/bdist.linux-i686/egg/genshi/template/eval.py", line 364, in undefined
    raise UndefinedError(key, owner=owner)
UndefinedError: "resolution" not defined

It seems the mail is not sent because of a missing 'resolution' field somewhere.

Here is my notification section of trac.ini (privated fields where replaced here by _PRIVATE_, just ignore):

[notification]
admit_domains = _PRIVATE_.com
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
ignore_domains =
mime_encoding = base64
smtp_always_bcc = j.vargas@_PRIVATE_.com
smtp_always_cc =
smtp_default_domain = _PRIVATE_.com
smtp_enabled = true
smtp_from = _PRIVATE_@_PRIVATE_.com
smtp_from_name = Dummy's Project SCM
smtp_password =
smtp_port = 25
smtp_replyto =
smtp_server = localhost
smtp_subject_prefix = __default__
smtp_user =
ticket_subject_template = $prefix #$ticket.id: $summary $resolution
use_public_cc = false
use_short_addr = false
use_tls = false

my version info:

Trac:  	0.11dev-r6363
Python: 	2.5.1 (r251:54863, May 2 2007, 16:53:27) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)]
setuptools: 	0.6c5
SQLite: 	3.3.13
pysqlite: 	2.3.2
Genshi: 	0.5dev-r786
Pygments: 	0.9
Subversion: 	1.4.3 (r23084)
jQuery:	1.2.1

Attachments (0)

Change History (2)

comment:1 by Emmanuel Blot, 17 years ago

Keywords: mail notification removed
Severity: blockermajor

Can you give a try with

ticket_subject_template = $prefix #$ticket.id: $summary

comment:2 by Jonathan Vargas <j.vargas@…>, 17 years ago

Resolution: invalid
Status: newclosed

Now it DOES work.

I though the $resolution placeholder would evaluate to ticket's resolution, as $summary does. Bu it required to be prefixed by "ticket." as in "$ticket.id".

Thanks for your support here and at IRC.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Emmanuel Blot.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Emmanuel Blot 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.