LDAP multivalue CustomerMap attributes

Moderator: crythias

Post Reply
Snowmanko
Znuny newbie
Posts: 59
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

LDAP multivalue CustomerMap attributes

Post by Snowmanko »

Hi all, @crythias, @jojo,

I am trying to implement multivalue dynamic LDAP Customer Map attributes. Documentation mention only about multivalue CustomerIDs, but not other attributes. For example I have LDAP object with CustomerID and all required related attributes, BUT I also have optional customer attributes that consist of let's say :
- customer endpoint
- endpoint status
- telephone number
(these attributes are able to be multivalue - i.e. customer has multiple phone numbers)
Let's say there are 3 telephone numbers. How do I parse these to Map variables in configuration ?

Map example :
Map => [
# note: Login, Email and CustomerID needed!
[ 'UserFirstname', 'Firstname', 'x-my-SAP-Name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'x-my-SAP-ID', 1, 1, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'x-my-SAP-Email', 1, 1, 'var', '', 0 ],
[ 'UserEndpoint', 'Endpoint 1', 'x-my-SAP-UserEndpoint', 1, 1, 'var', '', 0 ],
[ 'UserEndpointStatus', 'Status 1', 'x-my-SAP-UserEndpointStatus', 1, 1, 'var', '', 0 ],
[ 'UserTelephoneNumber', 'Number 1', 'x-my-SAP-UserTelephoneNumber', 1, 1, 'var', '', 0 ],
],

How do I make fields/vars UserEndpoint, UserEndpointStatus, UserTelephoneNumber dynamic ? Is it possible ?
In LDAP, x-my-SAP-UserTelephoneNumber attribute of CustomerUser Object is not defined in schema as "SINGLE-VALUE", but without it, so there can be also 2 or more attributes with another values that holds i.e. multiple mobile phone numbers. Because our customers can have multiple Endpoints/Statuses and also i.e. telephone numbers.

Thanks in advance for any suggestion.
BR,
Martin
OTRS 6.0.3-1, MySQL
Snowmanko
Znuny newbie
Posts: 59
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: LDAP multivalue CustomerMap attributes

Post by Snowmanko »

Nobody tried it ?
OTRS 6.0.3-1, MySQL
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: LDAP multivalue CustomerMap attributes

Post by crythias »

I haven't had a chance to look at it, but it's possible (?) that attribute[0] and attribute[1] might work. I can't be sure.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
root
Administrator
Posts: 3931
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: LDAP multivalue CustomerMap attributes

Post by root »

Hi,

OTRS uses the following code:

Code: Select all

my $Value = $Self->_ConvertFrom( $Result2->get_value( $Entry->[2] ) ) || '';
From the documentation of Net::LDAP:
In a scalar context returns the first value for the attribute or undef if the attribute does not exist.
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Snowmanko
Znuny newbie
Posts: 59
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: LDAP multivalue CustomerMap attributes

Post by Snowmanko »

Do you think there is some way to change this ? We need to have multiple same attributes related to our Customers object.
OTRS 6.0.3-1, MySQL
root
Administrator
Posts: 3931
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: LDAP multivalue CustomerMap attributes

Post by root »

Snowmanko wrote:Do you think there is some way to change this ? We need to have multiple same attributes related to our Customers object.
This should be possible with custom development and depends on the use case. Which is?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Snowmanko
Znuny newbie
Posts: 59
Joined: 06 Mar 2015, 17:45
Znuny Version: 6.0.5-1

Re: LDAP multivalue CustomerMap attributes

Post by Snowmanko »

As I stated in first post, I want to add multiple Customer information i.e. I want to add multiple phone numbers (attribute in LDAP - phoneNumber can be stated in object multiple times), i.e. I want to add multiple CustomerEndpoints (this means something like office branch), under this CustomerEndpoint there should be information like EndpointNumber (next attribute), EndpointStatus and so on.

So at the end, when ticket will be created and Customer will be asigned to ticket I want to use http://doc.otrs.com/doc/manual/admin/st ... stomeruser to asign specific problematic CustomerEndpoint to ticket dynamic fields. (this is example)

I hope my use case is understandable.
OTRS 6.0.3-1, MySQL
root
Administrator
Posts: 3931
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: LDAP multivalue CustomerMap attributes

Post by root »

Hi,

That's possible with custom development by creating a event handler or modifying the LDAP backend.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Post Reply