NAME

OTRS::ForwardQueue - Forwards the contents of an OTRS queue to a given email address.

VERSION

This document describes OTRS::ForwardQueue version 0.0.1.

SYNOPSIS

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

$fp->process_queue();

DESCRIPTION

This module queries the Open Technology Real Services (OTRS) ticket management system for ticketss matching the query provided and then forwards these tickets to an email address, closing them in OTRS.

The original motivation for writing this module was to re-assign tickets which were reported in the incorrect system.

The following functions are provided:

new(\%query, \%options)

Produced automatically by Moose, this is the constructor for the class.

\%query

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

\%options

Required list of options which affect how the queue is processed.

HistoryComment (required): The comment left in the history of the ticket when it is forwarded to anther system.
TempDir (optional): Override the temporary directory used by the OTRS cache. Probably needs to be set if you are not running the module as the web server user (e.g. apache). If you get errors about file permissions, try setting this to '/tmp'.
ForwardTo (required): The email address to forward tickets to.
DisableLocking (optional): Set to 1 to disable locking of forwarded tickets. Default behaviour is to lock tickets.
DisableHistory (optional): Set to 1 to disable leaving a comment in the history (effectively makes HistoryComment redundant). Default behaviour is to add a comment.
DisableClosing (optional): Set to 1 to disable closing the ticket after forwarding. Default behaviour is to mark ticket as 'closed successful'.
DisableEmail (optional): Set to 1 to disable sending any emails, which effectively prevents forwarding of tickets. Default behaviour is to send email. Included as an option to allow module users to test their code before sending out emails.
SMTP (optional): Set to 1 to use an SMTP server to send email, instead of the local MTA.
SMTPServer (optional): Host name or IP address of the SMTP server to use. Only effective if SMTP is set to 1.
NotifyCustomer (optional): Set to 1 to create a new article on the ticket and notify the customer that it has been forwarded.
NotifyCustomerTemplate (optional): Relative filename to template for customer notification. Required if NotifyCustomer is set to 1.
TemplatesPath (optional): Absolute path to template directory. Required if NotifyCustomerTemplate is set.
Debug (optional): Set to 1 to print extra debugging information, such as the IDs of forwarded tickets.

DEPENDENCIES

Perl version 5.14 or higher is required. You may be able to use the module in old versions of Perl, but this is neither tested nor supported.

This module requires the following modules:

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 only been tested with OTRS 3.2.10.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs through the Github issue system:

https://github.com/pwaring/otrs-forward-queue/issues

AUTHOR

Paul Waring <paul.waring@manchester.ac.uk>

SUPPORT

You can find documentation for this module with the perldoc command.

COPYRIGHT AND LICENSE

Copyright (c) 2014, University of Manchester. All rights reserved.

Licensed under the GNU Affero GPLv3.