Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Tip

For complex mapping, functions have to be implemented separately.

See the demo package under Downloads.

User cases

In case you need the freedom of e.g.:

  • mapping linear values to a nonlinear scale
  • updating more than one Jira value based on one OTRS value
  • updating one Jira value based on multiple OTRS values

General configuration

A function can be used either on the left or on the right hand side of the mapping table:

Image Added

The syntax is as follows:

Code Block
languageperl
call:Perl::Path::Module,functionName
  • call:
    • The prefix to tell the mapping it is a function
  • Perl::Path:
    • The Module's Perl Package
  • Module:
    • The Module's name
  • functionName:
    • The name of the function to call inside of the Module

Parameters

Left hand side functions

Functions called on the left hand side, the function mapOTRSOptionFieldDemoUser2JIRAAssignee in the screenshot above, will be passed three parameters:

  1. $TicketJIRAObj
    • An Instance of Kernel::System::TicketJIRA
  2. $fieldmapping
    • The entries from the SysConfig: TicketJIRA###OTRS-JIRA-FieldMapping
  3. %Ticket
    • An instance of Kernel::System::Ticket::Article

Right hand side functions

Functions called on the right hand side, the function mapOTRSOptionToJIRAOption in the screenshot above, will be passed four parameters:

  1. $TicketJIRAObj
    • An Instance of Kernel::System::TicketJIRA
  2. $val
    • The value as obtained by the left hand side of the mapping
  3. $fields
    • A Hash of key => values for Jira, e.g.:

      Code Block
      languageperl
      titleExample of fields
       {
      	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,
      }
  4. %Ticket
    • An instance of Kernel::System::Ticket::Article