Get department and office field form LDAP for stats

Moderator: crythias

Post Reply
jeremy77
Znuny newbie
Posts: 10
Joined: 10 Dec 2010, 21:41
Znuny Version: 3.0.2

Get department and office field form LDAP for stats

Post by jeremy77 »

We are using ldap for our customer database and authenticatoin and would like to be able to report on the deparment and office of the customer who submitted the ticket. We are able to authenticate with LDAP and it asigns the proper customer_id and customer_user_id. I asume we wil have to work with the freetext keys.

How would we post the department and office information from the LDAP database to the ticket table in order to report on office and department ticket activity?

I've searched through the message boards and other posts but cannot find a solution.

Thank you in advance for you time an suggestions.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Get department and office field form LDAP for stats

Post by crythias »

You can use the map in Config.pm to report on the Department, I believe.

Code: Select all

        Map => [
            # note: Login, Email and CustomerID are mandatory!
            # if you need additional attributes from AD, just map them here. <---
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
#            [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', '', 0 ],
            [ 'UserFirstname',  'Firstname',   'givenname',       1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',    'sn',              1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',    'sAMAccountName',             1, 1, 'var', '', 0 ],
            [ 'UserEmail',      'Email',       'mail',            1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID',  'mail',            0, 1, 'var', '', 0 ],
#            [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 1, 0, 'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'telephoneNumber', 1, 0, 'var', '', 0 ],
#            [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
#            [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
            [ 'UserMobile',     'Mobile',      'mobile', 1, 0, 'var', '', 0 ],
            [ 'UserRoom',       'Room',        'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        ],

Code: Select all

[ 'UserDepartment', 'Department', 'department', 1, 0, 'var', '', 0],
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
AFAICT,
the var is the variable that would be referenced in programming.
the frontend is the description/label
the storage is the source of the data (field from AD to pull)
storage-type seems to be consistently "var"
http-link appears to be consistently ''
readonly appears to be consistently 0 (it appears that the global readonly=>1 overrides this anyway.)
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
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Get department and office field form LDAP for stats

Post by crythias »

Although, in retrospect, nothing in the ticket will tell you what the department or office is, so maybe it won't be so helpful unless the ticket is tagged with the department or group or the customers are in Customer Groups.
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
jeremy77
Znuny newbie
Posts: 10
Joined: 10 Dec 2010, 21:41
Znuny Version: 3.0.2

Re: Get department and office field form LDAP for stats

Post by jeremy77 »

The challenge seems to be posting that information to the freekey freetext pair. The LDAP data is being posted for customer_id and customer_user_id but how do I point the department and office information to the free* fields. I think if the info is inserted to the ticket table I can report on it.
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Get department and office field form LDAP for stats

Post by Mothra »

jeremy77 wrote:The challenge seems to be posting that information to the freekey freetext pair. The LDAP data is being posted for customer_id and customer_user_id but how do I point the department and office information to the free* fields. I think if the info is inserted to the ticket table I can report on it.
I don't think that will ever work - TicketFreeKey and TicketFreeText relate to Tickets, whereas the LDAP sync is for copying user (Agent/Customer) data.

You may get more success by syncing the department from AD/LDAP to the UserComment field, like this:

Code: Select all

[ 'UserComment', 'Comment', 'department', 1, 0, 'var', '', 0 ],
However, I have not had time to test this myself. If it works, you could customise your themes to relabel this field as "Department" in the UI, and use it exclusively for this purpose.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Get department and office field form LDAP for stats

Post by jojo »

this only works with some development (event module). OTRS Inc. / xxx can develop this for you..
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Post Reply