Extension:OtrsTicket


 * This extension is work in progress – contact the author for questions regarding the state of the work

OtrsTicket adds a limited ability to do read-only access of attributes from one or more OTRS instances, allowing easy integration with OTRS for the purpose of displaying current state of the tickets. It will enforce policy on access according to LocalSettings.php, and all data made available will be readable for everyone with read access to the generated page. Multiple OTRS-instances can be configurated, with different access policy for each one.

Usage
One or more external instances of OTRS, a ticketing system, is queried over the SOAP interface about the set values of a number of attributes. Each value is either reported as a single value or as a composite structure, each with or without a leading identifier. The purpose of the reporting is for embedding the information within a human readable page, still there can be additional markup to make the information machine readable.

The instance must be given and this identifies the OTRS-system. An instance has the necessary log on tokens, the access policy for the individual data fields and possibly filters (regexps) for the query strings. These will be set in  and can't be overridden.

Some requests that is usually not human readable (or human friendly) will be translated to a more friendly form. This may give an additional request to the OTRS-system, and will be cached if possible.

Parameters not used for the parser functions own internal purposes or filtered and passed on to OTRS will be silently discarded.


 * Identified single ticket : Basic usage is to access a ticket through the ticket number, optionally querying one or more attributes


 * Search for multiple tickets : Basic usage is to search for multiple tickets by adding one or more search parameters, optionally querying one or more attributes
 * Note: Lists can be given to query-value by using a broken pipe character.
 * Note: Lists can be given to query-value by using a broken pipe character.


 * Listing queues : Basic usage is to list all queues, optionally querying one or more attributes

Presentation
A number of values can be changed that changes the presentation. Defaults are system messages that are overridden by named parameters. If the format is for complex presentation, it will not use the dataseparator and the attribute names will be included. If the format is for simple presentation, it will only use the dataseparator and no attribute names.

A standardized form is used in the message namespace, MediaWiki:otrs-function-parameter. Available parameters are
 * dataprepend : Initial message rendered before any data output. Makes available instance function name and ticket number. Defaults to, that is it starts a data list.
 * datatext : Formats the attribute name. Makes available the name and any translations. Part of the complex presentation. Defaults to, that is the translated string.
 * datadefinition : Formats the attribute value. Makes available the value. Part of the complex presentation. Defaults to, that is an identity function.
 * dataappend : Final message rendered after any data output. Makes nothing available. Defaults to, that is it ends a data list.
 * dataseparator : A message rendered between each value. Makes nothing available. Part of the complex presentation. Defaults to, that is [space][middot][space].
 * listprepend : Initial message rendered before any list output. Makes available instance and function name. Defaults to, that is it starts a table.
 * listitem : Formats each data item, which my be a simple or complex data item. Makes available the data item and its index. Defaults to
 * listprepend : Initial message rendered after any list output. Makes nothing available. Defaults to, that is it ends a table.
 * format : Sets the presentation to simple or complex. A single value defaults to simple while multiple defaults to complex.

Installation
First you need an up and running OTRS installation. Then you must enable the SOAP interface, and set up the SOAP user and password
 * 1) Login into your existing OTRS Installation as Admin
 * 2) In the Menu “Admin”->”Sysconfig” set Group to “Framework” and click “show”
 * 3) In the list of subgroups click “Core::SOAP”
 * 4) Check the boxes for SOAP::User: and SOAP::Password: and enter the values you like
 * 5) Click update

The usual: Copy OtrsTicket.php and OtrsTicket.i18n.php to a subfolder OtrsTicket in the extensions folder, then add the following to LocalSettings.php:

Additionally there should be defined some OTRS-system to access

Note that any additional access policy not turned on by default must be explicitly turned on to be made available

Security issues
Greate care should be given to define the defaults, and where defaults are set to limit access you should be very careful to override those. Especially if the OTRS-system has limited access and the wiki is open, there will be possible to leak information from the OTRS-system and out to the public through the wiki.

Some search parameters should not be implemented at all.

Bugs/Todo

 * Errors during log in can be placed in wrong context.
 * Only single ticket is implemented