OTRS::ForwardQueue - Forwards the contents of an OTRS queue to a given email address.
version 0.13
use OTRS::ForwardQueue; %query = ( Queues => ['MyQueue'], States => ['new', 'open'], Locks => ['unlock'], UserID => 1, ); %options = ( ForwardTo => 'nobody@example.org', TempDir => '/tmp', HistoryComment => 'Forward to other request system', SMTP => 1, SMTPServer => 'smtp.example.org', NotifyCustomer => 1, NotifyCustomerTemplate => 'notify_customer.tt', TemplatesPath => '/usr/local/templates', Debug => 1, ); my $fq = OTRS::ForwardQueue->new('query' => \%query, 'options' => \%options); $fq->process_queue();
This module queries the Open Technology Real Services (OTRS) ticket management system for tickets matching the query provided and then forwards these tickets to an email address, closing them in OTRS.
The following functions are provided:
Produced automatically by Moose, this is the constructor for the class.
Reference to a hash which contains the query parameters. This takes the same key/value pairs as the TicketSearch function of Kernel::System::TicketSearch, except that the Result value is always set to 'ARRAY'.
TicketSearch
Kernel::System::TicketSearch
Result
Required list of options which affect how the queue is processed.
HistoryComment
TempDir
'/tmp'
ForwardTo
DisableLocking
DisableHistory
DisableClosing
DisableEmail
SMTP
SMTPServer
NotifyCustomer
NotifyCustomerTemplate
TemplatesPath
Debug
Processes the queue based on the options passed in the constructor.
Perl version 5.14 or higher is required. You may be able to use the module with older versions of Perl, but this is neither tested nor supported.
This module requires the following modules:
Moose
namespace::autoclean
Email::Simple
Email::Sender
Template - For dynamically producing the body of emails.
Although some of the above modules are used for optional features, all the dependencies must be installed as this module will attempt to import all of them.
You must also have the OTRS source installed and available via @INC. This module has been tested with OTRS 3.2.10 and 3.3.9.
@INC
Running a script which uses this module as a cron job may require some additional tweaks. The easiest way is to create a small wrapper script to set the various library paths correctly, such as the one below:
#!/bin/bash # Set this to the absolute path to your OTRS install, so those # modules can be loaded FQ_OTRS_LIB="-I/path/to/otrs" # Comment out this line if you are not using local::lib FQ_LOCAL_LIB="-I$HOME/perl5/lib/perl5" # Change this to the path of your script /usr/bin/perl "$FQ_OTRS_LIB" "$FQ_LOCAL_LIB" /path/to/script.pl
None reported.
No bugs have been reported.
Please report any bugs through the Github issue system:
https://github.com/pwaring/OTRS-ForwardQueue/issues
Paul Waring <paul.waring@manchester.ac.uk>
This software is Copyright (c) 2014 by University of Manchester.
This is free software, licensed under:
The GNU Affero General Public License, Version 3, November 2007
To install OTRS::ForwardQueue, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OTRS::ForwardQueue
CPAN shell
perl -MCPAN -e shell install OTRS::ForwardQueue
For more information on module installation, please visit the detailed CPAN module installation guide.