Teamworkx OTRS Integration for Jira also allows a more complex field mapping. This can be useful in the following cases:
To do a complex mapping, functions have to be implemented separately.
See the demo package under Downloads. |
Read the following:
A function can be used either on the left or on the right hand side of the mapping table:

The syntax is as follows:
call:Perl::Path::Module,functionName |
call: Prefix to tell the mapping it is a functionPerl::Path: Module's Perl packageModule: odule's namefunctionName: Name of the function to call inside of the moduleFunctions called on the left hand side, the function mapOTRSOptionFieldDemoUser2JIRAAssignee in the screenshot above, will be passed three parameters:
$TicketJIRAObj: An Instance of Kernel::System::TicketJIRA$fieldmapping: The entries from the SysConfig: TicketJIRA###OTRS-JIRA-FieldMapping%Ticket: An instance of Kernel::System::Ticket::Articlemy ($TicketJIRAObj, $fieldmapping, %Ticket) = @_; |
Functions called on the right hand side, the function mapOTRSOptionToJIRAOption in the screenshot above, will be passed four parameters:
$TicketJIRAObj: An Instance of Kernel::System::TicketJIRA$val: The value as obtained by the left hand side of the mapping$fields: A Hash of key => values for Jira, e.g.:
{
project => { key => "ASDF" },
issuetype => { name => "Bug" },
summary => "Title from the Article",
description => "The multi line Body of the Article",
reporter => { name => "Reporter" },
assignee => { name => "Assignee" },
customfield_12345 => "Value",
customfield_12346 => 42,
} |
%Ticket: An instance of Kernel::System::Ticket::Article
my ($TicketJIRAObj, $val, $fields, %Ticket) = @_; |
A Complete example of a installable OTRS package (OPM) is available at bitbucket.org/cwx/jirademoplugins. This package actually makes use of additional settings that are defined in an included XML file. Feel free to explore the examples included therein. |
Strictly speaking you can do anything, even just create a value to be send to Jira for a special field.
| Key | Contents |
|---|---|
call:Douglas::Adams::HHGTTG,answer | cust:answer |
package call:Douglas::Adams;
use strict;
sub answer {
my ($TicketJIRAObj, $fieldmapping, %Ticket) = @_; // ignored in this example anyway
return 42; // this is the only important answer anyway :-)
} |