CompanyTickets using UserCustomerIDs field

Moderator: crythias

Locked
marty210578
Znuny newbie
Posts: 22
Joined: 04 Apr 2011, 16:15
Znuny Version: OTRS 3.0.10
Real Name: Martijn

CompanyTickets using UserCustomerIDs field

Post by marty210578 »

Hello All,

We want to utilize the Customer portal and up to now the users can see their own tickets under both "my tickets" and "Company Tickets"
The config.pm containts this config for the users

Code: Select all

###############################################
#LDAP CustomerUser -  Netherlands
################################################
#        # use customer company support (reference to company, See CustomerCompany settings)
        CustomerCompanySupport => 1,

#(customer user database backend and settings)
    $Self->{CustomerUser1} = {
      Name => 'LDAP ABG NL',
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
      Host => 'certain host',
      BaseDN => 'something',
      SSCOPE => 'sub',
      UserDN =>'CN=CMNOTRS',
      UserPw => 'password',
#Alwaysfilter is required othrwise we see all objects in the database and we want only to see users.
      #AlwaysFilter => '(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=intranet,DC=msd)'
      AlwaysFilter => '(&(!(objectClass=Computer))(!(objectClass=Group))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))',
     
    },
# customer unique id
    CustomerKey => 'sAMAccountName',
    # customer #
    [b]CustomerID => 'mail',[/b]
    CustomerUserListFields => ['sAMAccountName','displayName','mail'],
    CustomerUserSearchFields => ['sAMAccountName','displayName','mail'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['mail'],
    CustomerUserNameFields => ['givenname', 'sn'],
    CustomerUserExcludePrimaryCustomerID => 0,
    # add a ldap filter for valid users (expert setting)
    CustomerUserValidFilter => '(!(description=locked))',
    # admin can't change customer preferences
    AdminSetPreferences => 0,

    Map => [
      # note: Login, Email and CustomerID needed!
      # var, frontend, storage, shown, required, storage-type
      #[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
      [ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
      [ 'UserFirstname', 'First name', 'givenname', 1, 1, 'var' ],
      [ 'UserLastname', 'Last name', 'sn', 1, 1, 'var' ],
      [ 'UserDisplayName', 'Display Name', 'displayName', 1, 0, 'var' ], 
      [ 'UserDescription', 'User Description', 'description', 1, 0, 'var' ],
      [ 'UserOffice', 'Office', 'physicalDeliveryOfficeName', 1, 0, 'var' ],
      [ 'UserCountry', 'Country', 'co', 1, 0, 'var' ],
      [ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
      [ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
    [b]  [ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
      [ 'UserCustomerIDs', 'CustomerIDs', 'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],[/b]
      [ 'UserTitle', 'Job Title', 'Title', 1, 1, 'var' ],
      [ 'UserDepartment', 'Department', 'Department', 1, 0, 'var' ], 
      [ 'UserCompany', 'Company', 'company', 1, 0, 'var' ], 
      [ 'UserManager', 'Manager', 'manager', 1, 0, 'var' ],
    ],
   };
As you can see for customerID we are using the mail addres-> which explains why the customer sees only his tickets in the "company ticket" tab.
I have read many articles on the forum. simplest solution us to using for "customerID" the physicalDeliveryOfficeName attribute, but i don't want to go that route.

Why is there something as UserCustomerIDs', 'CustomerIDs for LDAP when it's not being used?? yeah in the customer details i can see it's being filled butt it's not being used in any configuration file/option in order to have simply utilize the UserCustomerIDs in the customerportal.

When i see the ticket table structure it only holds:
customer_id & customer_user_id

Customer id is filled with : emailadres
customer_user_id is filled with the loginname of the user.

Why is there not a field : UserCustomerIDs which is filled with the (in my case) physicalDeliveryOfficeName attribute ?
that way there would be a option for my to have OTRS customer portal display all the tickets for that physicalDeliveryOfficeName / department

So after a long story my question is:
How can i use " UserCustomerIDs" in Customerportal.??
Without using the department in the UserCustomerID

Many thanks already and i i need to provide more details just let me know

btw im using OTRS 3.010
OTRS Version OTRS 3.0.10
ITSM 3.05
yuri0001
Znuny superhero
Posts: 630
Joined: 17 Mar 2011, 14:40
Znuny Version: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: CompanyTickets using UserCustomerIDs field

Post by yuri0001 »

Hi!
You can replace in Map -> CustomerID from e-mail of customer to Company or Department (as it named in AD). As you can see in Admin Area - CustomerID is used as CompanyID. Company Name you can establish in Customer Company section of Admin Area in association with CustomerID.
Sorry my bad English. :?
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)
Locked