OPAR - OPM Package ARchive

Browseable collection of plugins for the popular ticket system software Znuny and ((OTRS)) Community Edition.


GIExtension

Version
6.0.10
Other Versions
6.0.6, 6.0.7, 6.0.9,
Uploaded by/on
reneeb on 18 May 2023
Framework
6.0.x, 6.1.x, 6.2.x, 6.3.x, 6.4.x, 6.5.x, 7.0.x
Links
Download Website
Description
Some improvements for the GenericInterface

Rate/comment this package

GIExtension

This is a library with additional GenericInterface operations.

Those operations include

Ticket::TicketGetFiltered

You can use this as a drop-in replacement for TicketGet. Additionally you can write filters to change the returned values.

For our GroupRestrictedDynamicFields addon, we wrote a filter to remove the dynamic fields for those users who do not have the permission to see them.

Those filters are simple Perl modules. You have to activate them via system configuration:

    <Setting Name="GIExtension::TicketFilter###001-MyFilter" Required="0" Valid="1">
        <Description Translatable="1">A filter for GIExtensions.</Description>
        <Navigation>GenericInterface::Filter</Navigation>
        <Value>
            <Hash>
                <Item Key="Module">Kernel::GenericInterface::Filter::MyFilter</Item>
            </Hash>
        </Value>
    </Setting>

And the module looks like:

    package Kernel::GenericInterface::Filter::MyFilter;
    
    use strict;
    use warnings;
    
    our @ObjectDependencies = qw(
        Kernel::System::Log
    );
    
    sub new {
        my ($Type, %Param) = @_;
    
        my $Self = bless {}, $Type;
    
        return $Self;
    }
    
    sub Run {
        my ($Self, %Param) = @_;
    
        # maybe remove some fields from $Param{Ticket}
        # %Param has the return values you can see for
        # the TicketGet operation
    
        return $Param{Ticket};
    }
    
    1;

CustomerCompany::DynamicFieldUpdate

Similar to the CustomerUser::DynamicFieldUpdate operation, but for customers.

CustomerCompany::CustomerCompanyAdd

Allows agents to add new customer users

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerCompany" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserCustomerID" : "12345",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

Which fields are available depends on your system configuration.

CustomerCompany::CustomerCompanyUpdate

Allows agents to add new customer users

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerCompanyID": 123,
        "CustomerCompany" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserCustomerID" : "12345",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

Which fields are available depends on your system configuration.

CustomerCompany::CustomerCompanySearch

Searches for customer users and returns a list of customer user IDs.

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerCompany" : {
            "UserLogin"     : "example*",
            "UserFirstname" : "Firstn*",
            "CustomerCompanySearchCustomerIDs" : [
                "example.com"
            ],
            "ExcludeUserLogins" : [
                "example", "doejohn"
            ],
            "UserCountry" : [
                "Austria", "Germany"
            ],
            "DynamicField_FieldNameX" : {
                "Equals"            : 123,
                "Like"              : "value*",
                "GreaterThan"       : "2001-01-01 01:01:01",
                "GreaterThanEquals" : "2001-01-01 01:01:01",
                "SmallerThan"       : "2002-02-02 02:02:02",
                "SmallerThanEquals" : "2002-02-02 02:02:02"
            }
            "OrderBy" : [ "UserLogin", "UserCustomerID" ]
        }
    }

See SysConfig option CustomerCompany::EnhancedSearchFields for a list of fields that can be searched.

CustomerCompany::CustomerCompanyGet

Similar to the core Ticket::TicketGet operation.

CustomerUser::DynamicFieldUpdate

Allows agents to update a dynamic field for a customer user

To use it, select this operation as a controller for the GenericInterface provider. Then configure the provider and use e.g. /CustomerUser/:CustomerUserID for the route mapping.

Then you can send this JSON to your OTRS:

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "DynamicField": [{
                "Name": "my_dynamic_field",
                "Value": "new_value"
        }]
    }

CustomerUser::CustomerUserAdd

Allows agents to add new customer users

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerUser" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserCustomerID" : "12345",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

Which fields are available depends on your system configuration.

CustomerUser::CustomerUserUpdate

Allows agents to add new customer users

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerUser" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserCustomerID" : "12345",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

Which fields are available depends on your system configuration.

CustomerUser::CustomerUserSearch

Searches for customer users and returns a list of customer user IDs.

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "CustomerUser" : {
            "UserLogin"     : "example*",
            "UserFirstname" : "Firstn*",
            "CustomerCompanySearchCustomerIDs" : [
                "example.com"
            ],
            "ExcludeUserLogins" : [
                "example", "doejohn"
            ],
            "UserCountry" : [
                "Austria", "Germany"
            ],
            "DynamicField_FieldNameX" : {
                "Equals"            : 123,
                "Like"              : "value*",
                "GreaterThan"       : "2001-01-01 01:01:01",
                "GreaterThanEquals" : "2001-01-01 01:01:01",
                "SmallerThan"       : "2002-02-02 02:02:02",
                "SmallerThanEquals" : "2002-02-02 02:02:02"
            }
            "OrderBy" : [ "UserLogin", "UserCustomerID" ]
        }
    }

See SysConfig option CustomerUser::EnhancedSearchFields for a list of fields that can be searched.

CustomerUser::CustomerUserGet

Similar to the core Ticket::TicketGet operation.

User::UserAdd

Allows agents to create new agents. Of course the permissions are checked.

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "User" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

User::UserUpdate

Allows agents to update agents. Of course the permissions are checked.

The JSON should look like

    {
        "UserLogin": "an_agent",
        "Password": "agents_password",
        "User" : {
            "UserFirstname"  : "Huber",
            "UserLastname"   : "Manfred",
            "UserLogin"      : "mhuber",
            "UserPassword"   : "some-pass",
            "UserEmail"      : "email@example.com",
            "ValidID"        : 1
        }
    }

Session::SessionCheck

Checks only if the given session id is valid. In contrast to the core Session::SessionGet operation, this operation does not return any session details.

Session::SessionDelete

Deletes a session. Needs only the session id as a parameter. Before the session is deleted, it is validated.

Comments