[otrs] Bulk exporting tickets/articles to email

435 views
Skip to first unread message

Blue Web

unread,
May 29, 2015, 1:53:05 AM5/29/15
to ot...@otrs.org
Hello,

I need to export multiple tickets selected via generic agent process to plain .eml format. I know the generic agent allows to run ticket commands/custom modules, however it's unclear to me how to proceed. Would someone please be so kind to provide an example ?
What I need is to export all tickets/articles in a queue so that I am able to import them back to a mailbox.

Thanks,
gs

Gerald Young

unread,
May 29, 2015, 9:02:53 PM5/29/15
to User questions and discussions about OTRS.
There is no optimal way to do this. One way would be to print (to pdf) the tickets and you have them.

The following is just an idea:

You could use bin/otrs.GetTicketThread.pl

But what would be the goal? you'd still need to get (something) into an email and I can pretty much guarantee you're not going to get something immediately threadable and certainly not attachments.


TicketID 1 looks like this:

=====================================================================
TicketNumber: 2010080210123456
TicketID: 1
Created: 2010-08-02 08:00:00
Queue: Raw
State: new
Priority: 3 normal
Lock: unlock
---------------------------------------------------------------------
ArticleID: 1
From: OTRS Feedback <feed...@otrs.org>
To: Your OTRS System <otrs@localhost>
Subject: Welcome to OTRS!
Created: 2010-08-02 08:00:00
SenderType: customer
Body:
---------------------------------------------------------------------

Then you'll need to parse this into something that you'll want to use in email. You can use any command line command, with ARG[1] being the ticket id
maybe something like 
/opt/otrs/bin/otrs.GetTicketThread.pl -t ARG[1] > /path/out/ARG[1].txt

This might (?) make a bunch of text files. Note that you could, in theory, pipe the thread(s) to a command that nicely formats your email or mail it or ... 

Nothing here is tested. It may break things. It may not even work. Note that if you do export a LOT, you should make sure you don't run out of disk space.

---------------------------------------------------------------------
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

Blue Web

unread,
Jun 6, 2015, 2:16:21 AM6/6/15
to User questions and discussions about OTRS.
You could use bin/otrs.GetTicketThread.pl
But what would be the goal? you'd still need to get (something) into an email and I can pretty much guarantee you're not going to get something immediately threadable and certainly not attachments.

Well, the goal is to import back the article (or the entire ticket thread) into a mail account, so the GetTicketThread is not exactly what I need, but could be useful as a template script if someone knows the OTRS methods necessary to export an article in original format (which can be saved into a .eml file), by exporting all the articles in a ticket thread to .eml file the .eml files could then be imported into any mailboxes.

 

Gerald Young

unread,
Jun 6, 2015, 3:31:18 PM6/6/15
to User questions and discussions about OTRS.
There is no "export an article in original format". That would be however you've backed up the source email. 

Reply all
Reply to author
Forward
0 new messages