[otrs] respect foreign ticket IDs

469 views
Skip to first unread message

Jan.D...@bertelsmann.de

unread,
Jan 15, 2013, 9:02:08 AM1/15/13
to ot...@otrs.org

Hi,

 

our client wants to send reports automatically on regular basis to our ticket system. The foreign system doesn’t know about the corresponding ticket number in OTRS, but has own identification numbers of the cases.

Is it possible to let OTRS sort the incoming mails into the corresponding ticket? E.g.

·         First appearance of a foreign number creates a ticket

·         Following references to the foreign number append the article to the existing OTRS ticket

 

It’s possible to modify the Mail headers (I think). So I thought about the following possible solution:

·         Insert a mail header X-OTRS-TicketNumber

·         In Postmaster Mail Account definition enable “Trusted”

·         OTRS automagically respects the foreign number

 

I think that’s Utopia, isn’t it? Are there any other ways? Do I have to modify the sources to let OTRS recognize the foreign numbers?

 

 

Regards

Jan Dreyer

IT Administrator / Operations Team / M-IT OMS

 

Renee B

unread,
Jan 15, 2013, 9:43:50 AM1/15/13
to ot...@otrs.org
You "only" need a postmaster filter (a Perl module, no filter via web interface) and a dynamic field where the external ticket number is stored...

- Renée


On 15.01.2013 15:02, Jan.D...@bertelsmann.de wrote:
Hi,

our client wants to send reports automatically on regular basis to our ticket system. The foreign system doesn't know about the corresponding ticket number in OTRS, but has own identification numbers of the cases.
Is it possible to let OTRS sort the incoming mails into the corresponding ticket? E.g.

*         First appearance of a foreign number creates a ticket

*         Following references to the foreign number append the article to the existing OTRS ticket

It's possible to modify the Mail headers (I think). So I thought about the following possible solution:

*         Insert a mail header X-OTRS-TicketNumber

*         In Postmaster Mail Account definition enable "Trusted"

*         OTRS automagically respects the foreign number

I think that's Utopia, isn't it? Are there any other ways? Do I have to modify the sources to let OTRS recognize the foreign numbers?


Regards
Jan Dreyer
IT Administrator / Operations Team / M-IT OMS




---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs


-- 
Perl / OTRS development: http://perl-services.de
OTRS AddOn repository: http://opar.perl-services.de

Jan.D...@bertelsmann.de

unread,
Jan 15, 2013, 10:20:34 AM1/15/13
to ot...@otrs.org

Hi Renée,

 

thanks for your answer.

The installation I was referring to has 2.4.11 (upgrade is planned), but either with 3.X I have no idea how to link the incoming articles referring to the same case to ONE OTRS ticket via dynfields L

 

 

Gruß

Jan Dreyer

IT Administrator / Operations Team / M-IT OMS

David Boyes

unread,
Jan 15, 2013, 10:46:56 AM1/15/13
to User questions and discussions about OTRS.

 

I think that’s Utopia, isn’t it? Are there any other ways? Do I have to modify the sources to let OTRS recognize the foreign numbers?

 

I would do this outside OTRS. If you control the mail server that receives mail for OTRS, give the client a specific alias for the automated reports and make sure their ticket number is in the Subject line. Write a script that extracts the subject line, parses out the foreign ticket # and looks it up in a database table. If not found, make an entry, and use the SOAP interface to create a ticket in OTRS. Capture the ticket # and put in the database table. If the foreign ticket # IS found, append it to the OTRS ticket # recorded in the database table.

 

No OTRS magic required, and no additional configuration to carry over to the next version of OTRS. Also pretty much transparent to the client, and can be easily replicated for multiple clients.

 

Renee B

unread,
Jan 15, 2013, 12:15:51 PM1/15/13
to ot...@otrs.org
Hi Jan,

On 15.01.2013 16:20, Jan.D...@bertelsmann.de wrote:
> Hi Renée,
>
> thanks for your answer.
> The installation I was referring to has 2.4.11 (upgrade is planned), but either with 3.X I have no idea how to link the incoming articles referring to the same case to ONE OTRS ticket via dynfields :(
>
>

Instead of a dynamic field you can use TicketFreeText as well ;-)

Regarding the matching:
The postmaster filter looks for the foreign ticket id (either in the
subject or in any other mail header field -- should be configurable). If
it finds one, the filter searches for tickets with the foreign id in the
freetextfield. If a ticket is found, the mail is handled as a follow up,
otherwise it's a new ticket (and the foreign id is saved in the
freetextfield).

- Renée

Jan.D...@bertelsmann.de

unread,
Jan 16, 2013, 2:52:38 AM1/16/13
to ot...@otrs.org

Hi David,

 

your solution sounds easy and I think I would be able to write such a script, thanks!

But:

On one hand I don’t like the idea of spreading this work away from the OTRS, on the other hand I _don’t_ control the mail server.

I _could_ do a fetchmail/procmail solution though, if nothing else works.

 

Regards

Jan Dreyer

IT Administrator / Operations Team / M-IT OMS

 

Von: otrs-b...@otrs.org [mailto:otrs-b...@otrs.org] Im Auftrag von David Boyes
Gesendet: Dienstag, 15. Januar 2013 16:47
An: User questions and discussions about OTRS.
Betreff: Re: [otrs] respect foreign ticket IDs

 

 

I think that’s Utopia, isn’t it? Are there any other ways? Do I have to modify the sources to let OTRS recognize the foreign numbers?

Michiel Beijen

unread,
Jan 16, 2013, 3:00:31 AM1/16/13
to User questions and discussions about OTRS.
Hi Jan,

What you're asking for is exactly what our "External Ticket Number Recognition" Feature Add-On does:

http://www.otrs.com/en/software/otrs-help-desk/features/otrs-feature-add-ons/feature-add-on-external-ticket-number-recognition/

Michiel Beijen
Senior Consultant

OTRS BV
Schipholweg 103
2316 XC Leiden
The Netherlands

T: +31 71 8200 255
F: +31 71 8200 254
I: http://www.otrs.com

It's raining ... OTRS Feature Add-Ons:  Choose up to 10 OTRS Feature Add-Ons for free and get direct support from the creators of OTRS  –  
Become a Subscription customer now ! - http://j.mp/OBoPuj


Jan.D...@bertelsmann.de

unread,
Jan 16, 2013, 3:05:09 AM1/16/13
to ot...@otrs.org
Hi Renée

That sounds like a lot of magic with regexp?! I still did not understand how to do the link.
I think, an example would be nice:

FID = foreign ID
OID = OTRS ID

Example:
We already received a ticket with FID 0815 and it got the OID 1234.
Incoming Mail with FID 0815.

PostmasterFilter:
Match:
Header 1: X-OTRS-TicketValue1
Value: [0-9]+ (????? No idea what has to go here)
Set:
Header 1: X-OTRS-?????
Value: ?????


As you see, I have no idea
* how to determine the corresponding OID
* how to SET the matching OID

I'm sure though it can't be too difficult ... :-/

Regards
Jan Dreyer
IT Administrator / Operations Team / M-IT OMS


-----Ursprüngliche Nachricht-----
Von: otrs-b...@otrs.org [mailto:otrs-b...@otrs.org] Im Auftrag von Renee B
Gesendet: Dienstag, 15. Januar 2013 18:16
An: ot...@otrs.org
Betreff: Re: [otrs] respect foreign ticket IDs

Jan.D...@bertelsmann.de

unread,
Jan 16, 2013, 3:20:45 AM1/16/13
to ot...@otrs.org

Hello Michiel

 

Aaaah, you are right! That sounds exactly like what I’m looking for. Let’s see if our client is willing to do a subscription  then …                                                                                                                                                                                                                                                     

 

Regards

Jan Dreyer

IT Administrator / Operations Team / M-IT OMS

 

Renee B

unread,
Jan 16, 2013, 3:42:38 AM1/16/13
to ot...@otrs.org
Hi Jan,

no magic. You said in the response to Davids mail that you are able to
write a script for that purpose, so you likely will be able to write a
postmaster filter for that.
As I said the Postmaster filters you can create via web frontend aren't
suitable here. You have to create a Perl module

see http://forums.otterhub.org/viewtopic.php?f=81&t=18362&hilit=+Postmaster
http://forums.otterhub.org/viewtopic.php?f=61&t=10837&p=42520&hilit=postmaster+attachment#p42520
http://forums.otterhub.org/viewtopic.php?f=61&t=18186&p=71564&hilit=Postmaster+filter#p71562
...

This is not that much work...

- Renée

Sune T. Tougaard

unread,
Jan 16, 2013, 4:12:11 AM1/16/13
to User questions and discussions about OTRS.
Hi,

I have not tried it at all for something like this, but perhaps a little creativity with the "System Monitoring" package (available from the "OTRS->Admin->Package Manager" interface) could help you along.
If not, I'm sure the Add-On that Michiel mentions will fit your needs perfectly.

--
/Sune

David Boyes

unread,
Jan 16, 2013, 10:51:03 AM1/16/13
to User questions and discussions about OTRS.

On one hand I don’t like the idea of spreading this work away from the OTRS, on the other hand I _don’t_ control the mail server.

I _could_ do a fetchmail/procmail solution though, if nothing else works.

 

Yeah. I would do this outside OTRS because it’s really a translation function between OTRS and something in the outside world. Neither OTRS or the outside world really needs to know about the translation process (and probably shouldn’t in the long run for scalability), and coding dependencies into OTRS for this kind of stuff always tends to be a pain to unwind later when/if the exception customer goes away. Fetchmail/procmail would be a good route to go for implementation if you can’t control the mail server – I tend to like to do stuff like this in /etc/aliases so it’s easy to find and migrate later, but c’est la vie.  

 

Having a ticket id mapping exit (disabled by default) in the base OTRS postmaster code would be worth submitting as a suggestion, though.  Or model it on the Nagios integration package – hmm… what if you tinkered with the Nagios integration package and supplied a different regexp that could recognize the incoming reports from your foreign ticketing system? That might work (haven’t tried it, but in theory all the code is there to create/match/close incoming tickets based on a pattern).

 

David Boyes

unread,
Jan 16, 2013, 10:54:11 AM1/16/13
to User questions and discussions about OTRS.

http://www.otrs.com/en/software/otrs-help-desk/features/otrs-feature-add-ons/feature-add-on-external-ticket-number-recognition/

Neat! Haven’t encountered that one before. Should have figured that the OTRS folk had encountered this before... 8-)

Reply all
Reply to author
Forward
0 new messages