Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#188 closed enhancement (fixed)

Update ticket based on subject

Reported by: icon@… Owned by: bas
Priority: major Milestone: release 2.0.0
Component: email2trac Version:
Keywords: Cc:

Description

I'm planning to use email2trac, but I have a small problem -- the email I need to use for requests is frequently CC'd by my clients as part of long conversation threads. As a result, a bunch of tickets are created that should really be updates to one ticket. Unfortunately, I can't really force them to set the #NNN for ticket number in the subject.

I was wondering if there is a possibility of an enhancement to update_ticket functionality: if there is a "Re:" in the subject and no ticket number, it would look at all tickets that are currently open and try to find a summary that matches the subject (with and without the "Re:"). If there is an open ticket with this match, it would update it instead of creating a new ticket.

Attachments (3)

email2trac-by-subject.patch (2.4 KB) - added by icon@… 10 years ago.
Attempted solution
email2trac-by-subject.2.patch (2.3 KB) - added by Konstantin Ryabitsev <icon@…> 10 years ago.
Slightly improved version of the patch.
update-by-subject-enhancement.patch (1.4 KB) - added by Konstantin Ryabitsev <icon@…> 10 years ago.
Enhancement to update-by-subject routines.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 10 years ago by bas

  • Status changed from new to assigned

I have to think about this feature. What you describe sounds logical. A question is the initial conversation started from trac ticket response?

Mabye we can add a @ticket: <nr> in the mail thread. But people can also delete/change this. The same hold for the subject line.

comment:2 Changed 10 years ago by icon@…

No, I'm usually cc'd in the middle of a discussion -- something like "Oh, while we're talking about it, can mricon also please do foo." The discussion then goes on between the original participants -- it stays relevant to what I need to do, but that results in 10 different tickets being created instead of all of it going into the ticket's comments. If I'm responding, I can set the subject to "Re: #nnn: [original subject]" but that's only a minor number of cases.

comment:3 Changed 10 years ago by bas

For some projects at our site we have the same problem. It is on my todo list

comment:4 Changed 10 years ago by icon@…

I was alternatively thinking of a separate plugin that could do "change ticket into a comment," but I think that would be less optimal. I'm currently making do with a combination of batchmodify plugins and ticket tracbacks plugin.

Changed 10 years ago by icon@…

Attempted solution

comment:5 Changed 10 years ago by icon@…

I've attached a solution I came up with. There's a couple of places where it can be improved, most notably I currently hardcode the "lookback" to 30 days. The logic is thus:

if looking for ticket number in the subject fails, then if email contains a "Re:" or a similar reply identifier, then look for any summary matching subject without "Re:" within the last 30 days if not found, look for unmodified subject within the last 30 days if found, update that ticket else create ticket

comment:6 Changed 10 years ago by bas

Thanks a lot for the patch. The first impression is it exactly what we need. Tomorrow at work i will apply it and test it on one of our projects.

Changed 10 years ago by Konstantin Ryabitsev <icon@…>

Slightly improved version of the patch.

comment:7 Changed 10 years ago by Konstantin Ryabitsev <icon@…>

This version removes an extraneous comment about querying only open tickets, and reworks the logic for guessing the "original" email. Instead of looking for exact subject match, it does a more general LIKE query to avoid case sensitivity problems with "Re:" and "RE:" not resulting in a match.

comment:8 Changed 10 years ago by bas

  • Milestone set to 1.4.0

comment:9 Changed 10 years ago by bas

(In [353]) email2trac.py.in:

  • Added patch to update ticket based on subject, see #188
  • must be approved. It can not handle Re: [project name]: <subject>

comment:10 Changed 10 years ago by bas

(In [354]) Some modification of ticket subject updates, see #188

comment:11 Changed 10 years ago by bas

(In [356]) email2trac.py.in:

  • added new function ticket_update_by_subject, see #188

comment:12 Changed 10 years ago by bas

I have enabled this option for some internal SARA projects so we have a live test

comment:13 Changed 10 years ago by bas

  • Version 1.3.2 deleted

Dear Konstantin,

Did you have time to test the trunk version? I did not encounter any problems during the testing period ;-)

Regards

comment:14 Changed 10 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

I will close it. It is applied to trunk and did not encounter any problems

comment:15 Changed 10 years ago by bas

(In [360]) Added an extra option ticket_update_by_subject_lookback in combo with ticket_update_by_subject. Default value is 30 days, see #188

comment:16 Changed 10 years ago by Konstantin Ryabitsev <icon@…>

  • Milestone 1.4.0 deleted
  • Resolution fixed deleted
  • Status changed from closed to reopened

Here is an enhancement to "update-by-subject". Features:

  1. Does a better job parsing out all the permutations of "Re: FW: Re: AW: Subject"
  2. Modifies the subject to drop the prefixes

Tested in production for about 2 weeks, works pretty well.

Changed 10 years ago by Konstantin Ryabitsev <icon@…>

Enhancement to update-by-subject routines.

comment:17 Changed 10 years ago by bas

Konstantin thanks for the patch, i will look into it.

comment:18 Changed 10 years ago by bas

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [487]) Enhancement to update-by-subject routines, closes #188

comment:19 Changed 10 years ago by bas

  • Milestone set to release 1.7.0

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.