Opened 7 years ago
Closed 7 years ago
#13333 closed defect (fixed)
'@created' rule prevents newticket request to complete
Reported by: | ntmlod | Owned by: | ejucovy |
---|---|---|---|
Priority: | normal | Component: | WorkflowNotificationPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
When submitting a new ticket, the request doesn't ended in the bowser but the ticket is created in the database. This leads to several duplicates in the system before the user realizes the problem.
I reproduced the issue on a local VM with the same Trac version (1.0.1) to have some logging
2017-11-13 18:29:32,428 Trac[__init__] DEBUG: Notification created for ticket 21 (action: @created) 2017-11-13 18:29:32,430 Trac[__init__] DEBUG: Sending notification created for ticket 21 because condition '${True}' did evaluate to True
From that, no more lines.
I changed the workflow event of my rule to *
then the problem disappeared. I have other rules that work without issue. Also I ran successfully trac-admin $env workflow_notifications validate
[ticket-workflow-notifications] created = @created created.body = Ticket created by ${ticket.reporter}. \n\nSummary: ${ticket.summary} \n\nDescription: \n${ticket.description} \n\nMain properties: {% for field in ticket %}\ {% choose field %}\ {% when 'version' %}- Version: ${ticket[field]}{% end %}\ {% when 'type' %}- Type: ${ticket[field]}{% end %}\ {% when 'priority' %}- Priority: ${ticket[field]}{% end %}\ {% otherwise %}{% end %}\ {% end %}\ {% end %}\ \n\nTo get further updates, subscribe to the ticket in the 'Cc' field. \n-- Ticket URL: <${link}> ${project.name} <${project.url}> ${project.descr} created.condition = ${True} created.recipients = ${ticket.reporter},${ticket.cc},xxxx@xxxxxxxx.xxxx created.subject = [Ticket] #${ticket.id}: ${ticket.summary}
Attachments (0)
Change History (3)
comment:2 Changed 7 years ago by
Replying to Ryan J Ollos:
The problem is with rendering the Genshi Text Template snippet.
Workaround:
[ticket-workflow-notifications] created = @created created.body = Ticket created by ${ticket.reporter}. \n\nSummary: ${ticket.summary} \n\nDescription: \n${ticket.description} \n\nMain properties: \n- Version: ${ticket.version} \n- Type: ${ticket.type} \n- Priority: ${ticket.priority} \n\nTo get further updates, subscribe to the ticket in the 'Cc' field. \n-- Ticket URL: <${link}> ${project.name} <${project.url}> ${project.descr} created.recipients = ${ticket.reporter},${ticket.cc},xxxx@xxxxxxxx.xxxx created.subject = [Ticket] #${ticket.id}: ${ticket.summary}
I'm a bit pessimistic because why I have an issue with @created
rule and not with my other rules which are build in the same way ? See below the rule for any edition of a ticket.
One other comment, when I set up the body of the messages sometimes I got a Trac error with undefined field but the request ended in the browser so to me a issue with Genshi doesn't seem to block the process.
edited = accept,reassign,leave edited.body = Ticket edited by ${change.author}. {% if change.comment %}\ \n\nComment: \n${change.comment} {% end %}\ {% if old_ticket['description'] and ticket['description'] != old_ticket['description'] %}\ \n\nNew description: \n${ticket[field]} {% end %}\ \n\nChanges: {% for field in old_ticket %}\ {% choose field %}\ {% when 'changetime' %}{% end %}\ {% when 'description' %}{% end %}\ {% otherwise %}\ {% if ticket[field] != old_ticket[field] %}- ${field}: ${old_ticket[field]} => ${ticket[field]} {% end %}\ {% end %}\ {% end %}\ {% end %}\ \n-- Ticket URL: <${link}> ${project.name} <${project.url}> ${project.descr}
In fact I'm trying to build a uniq template like ticket_notify_email.txt
but is this feasible ?
comment:3 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed.
I thought the same fields were available for any workflow event, at least any ticket['field']
for the current ticket.
In fact, not sure if I will succeed in setting a single model for any event.
The problem is with rendering the Genshi Text Template snippet.
Workaround: