Modify

Opened 11 years ago

Last modified 9 years ago

#321 assigned defect

How to avoid duplicate tickets?

Reported by: ivanelsonnunes@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.7.0
Keywords: duplicate tickets; fetchmail Cc:

Description

How to avoid duplicate tickets?! I'm using GLPI (HelpDesk). GLPI triggers emails to an account. I'm using Fetchmail.

The problem is when the GLPI some status updates and then sends an e-mail alert. This turns out creating a new ticket in Trac.

My email2trac.conf

[DEFAULT]
project: /var/trac/projects/claudino
ticket_permission_system: update_restricted_to_participants
debug: 1
black_list: MAILER-DAEMON@
drop_spam : 1
drop_alternative_html_version: 1
email_quote: >
html2text_cmd:
ignore_trac_user_settings: 0
inline_properties: 1
reply_all : 0
spam_level: 5
strip_quotes: 1
strip_signature: 0
ticket_update: 1
umask: 022
verbatim_format: 1
log_type: file
log_file: /tmp/email2trac.log
mta_user: nobody
DEFAULT_keywords  : ServiceDesk
DEFAULT_component : TRAC
DEFAULT_priority  : Alta
DEFAULT_severity  : Normal
DEFAULT_type      : Triagem

[claudino]
project: /var/trac/projects/claudino
cla_keywords  : ServiceDesk
cla_component : TRAC
cla_priority  : Alta
cla_severity  : Normal
cla_type      : Triagem

Attachments (0)

Change History (18)

comment:1 follow-up: Changed 11 years ago by bas

It depends. Is is it always the same subject and sender, because you have:

  • update_restricted_to_participants

There is another flag that does subject matching, but is must be a reply:

  • regex expression: re.compile(r'(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE)
  • ticket_update_by_subject

Can you adjust the emails subject?

comment:2 in reply to: ↑ 1 Changed 11 years ago by ivanelsonnunes@…

Replying to bas:

It depends. Is is it always the same subject and sender, because you have:

  • update_restricted_to_participants

There is another flag that does subject matching, but is must be a reply:

  • regex expression: re.compile(r'(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE)
  • ticket_update_by_subject

Can you adjust the emails subject?

In the message, does not have ":RE|FWD",etc.

comment:3 follow-up: Changed 11 years ago by ivanelsonnunes@…

Its set by Keyword? All e-mail alerts that I receive from GLPI (HelpDesk) has the hashtag # NNNN Where "nnnn" is the number of the Ticket (GLPI).

comment:4 in reply to: ↑ 3 ; follow-up: Changed 11 years ago by bas

Replying to ivanelsonnunes@…:

Its set by Keyword? All e-mail alerts that I receive from GLPI (HelpDesk) has the hashtag # NNNN Where "nnnn" is the number of the Ticket (GLPI).

Must these message all end up in the same ticket number or does the nnnn determine which ticket it is?

comment:5 in reply to: ↑ 4 Changed 11 years ago by ivanelsonnunes@…

Replying to bas:

Replying to ivanelsonnunes@…:

Its set by Keyword? All e-mail alerts that I receive from GLPI (HelpDesk) has the hashtag # NNNN Where "nnnn" is the number of the Ticket (GLPI).

Must these message all end up in the same ticket number or does the nnnn determine which ticket it is?

The pattern in the subject field of the email, there will always be:

Subject: [Service Desk #0007929] Blablabla, Blablabla Where "#0007929" is a control. Created in the >tool GLPI.

comment:6 follow-up: Changed 11 years ago by anonymous

Any ideas?

:)

comment:7 in reply to: ↑ 6 Changed 11 years ago by bas

Replying to anonymous:

Any ideas?

:)

So the id is always #0007929 and you can not adjust the subject?

comment:8 Changed 11 years ago by ivanelsonnunes@…

In the subject will always be "#0000ZZZZ" where "0000ZZZZ" is a number that represents a tool called in GLPI. This number may vary, of course.

The subject can be filtered by the "#" character?

comment:9 follow-up: Changed 11 years ago by ivanelsonnunes@…

If the content of the subject field already exists, so why the email2trac is failing to update the ticket?!

These parameters are useful for this.

ticket_update: 1
ticket_update_by_subject: 1
ticket_update_by_subject_lookback: 30

comment:10 in reply to: ↑ 9 Changed 11 years ago by bas

Replying to ivanelsonnunes@…:

If the content of the subject field already exists, so why the email2trac is failing to update the ticket?!

These parameters are useful for this.

ticket_update: 1
ticket_update_by_subject: 1
ticket_update_by_subject_lookback: 30

As told in an earlier message is that is must contain and RE: or something else to make this code to use this function:

SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE)

Can you adjust the code:

SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE)
result = SUBJECT_RE.search(subject)

by:

result = True

comment:11 follow-up: Changed 11 years ago by ivanelsonnunes@…

It worked!

see: https://gist.github.com/ivanelson/6025603

Very happy.

comment:12 in reply to: ↑ 11 ; follow-ups: Changed 11 years ago by bas

Replying to ivanelsonnunes@…:

It worked!

see: https://gist.github.com/ivanelson/6025603

Very happy.

Thanks for sharing. You basically use the subject line if it matches a keyword. I can make an option for it. Use the subject line for matching tickets or is this to broad?

comment:13 in reply to: ↑ 12 Changed 11 years ago by bas

Replying to bas:

Replying to ivanelsonnunes@…:

It worked!

see: https://gist.github.com/ivanelson/6025603

Very happy.

Thanks for sharing. You basically use the subject line if it matches a keyword. I can make an option for it. Use the subject line for matching tickets or is this to broad?

Or use some keywords that can trigger the subject line matching.

comment:14 in reply to: ↑ 12 Changed 11 years ago by ivanelsonnunes@…

Replying to bas:

Replying to ivanelsonnunes@…:

It worked!

see: https://gist.github.com/ivanelson/6025603

Very happy.

Thanks for sharing. You basically use the subject line if it matches a keyword. I can make an option for it. Use the subject line for matching tickets or is this to broad?

Yes, you can use the subject line.

I have made more changes. Eg

I changed the way the search summary to avoid duplication of ticket. The "GLPI" when updating a call, it does not use keys like: RE: FWD:, etc ... Also tried some exceptions.

https://gist.github.com/ivanelson/6236385

comment:15 Changed 11 years ago by bas

Can you just send a patch and attach this to teh ticket?

comment:16 Changed 10 years ago by ivanelsonnunes@…

I will embed my changes in the latest version of email2trac. After that I'll do the patch.

comment:17 Changed 10 years ago by bas

Did you succeed in creating the patch

comment:18 Changed 10 years ago by bas

  • Status changed from new to assigned

Add Comment

Modify Ticket

Change Properties
Action
as assigned The owner will remain bas.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas to the specified user. Next status will be 'new'.
Author


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

 
Note: See TracTickets for help on using tickets.