#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)
Change History (22)
comment:1 Changed 14 years ago by bas
- Status changed from new to assigned
comment:2 Changed 14 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 14 years ago by bas
For some projects at our site we have the same problem. It is on my todo list
comment:4 Changed 14 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.
comment:5 Changed 13 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 13 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.
comment:7 Changed 13 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 13 years ago by bas
- Milestone set to 1.4.0
comment:9 Changed 13 years ago by bas
comment:10 Changed 13 years ago by bas
comment:11 Changed 13 years ago by bas
comment:12 Changed 13 years ago by bas
I have enabled this option for some internal SARA projects so we have a live test
comment:13 Changed 13 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 13 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 13 years ago by bas
comment:16 Changed 13 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:
- Does a better job parsing out all the permutations of "Re: FW: Re: AW: Subject"
- Modifies the subject to drop the prefixes
Tested in production for about 2 weeks, works pretty well.
comment:17 Changed 13 years ago by bas
Konstantin thanks for the patch, i will look into it.
comment:18 Changed 13 years ago by bas
- Resolution set to fixed
- Status changed from reopened to closed
comment:19 Changed 13 years ago by bas
- Milestone set to release 1.7.0
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.