You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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:

The syntax is as follows:

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

      Example 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
  • No labels