Add custom fields into "add customer" records

Moderator: crythias

Post Reply
figozz
Znuny newbie
Posts: 7
Joined: 12 Oct 2012, 12:12
Znuny Version: 3.1.10
Real Name: Steve

Add custom fields into "add customer" records

Post by figozz »

Hi

I am running OTRS on a windows 7 operating system. I have the latest version 3.1.10

I have installed using the Windows installer

I am wondering if it is possible to add extra fields into the customer records?

For instance, I want to add a text entry field for "Internet Provider" somewhere below their username.

I have searched the forum and saw some other posts which I have tried to follow without success (about adding information into the kernel/config.pm file), although I wasnt very confident that I was doing the right thing.

After trying to modify the file I get an error when trying to save it saying access denied.

I have tried stopping the Apache service and then doing it but that didnt help.

If someone could provide step by step instruction on what I need to do that would be brilliant.

Thank you in advance.

Steve
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

figozz wrote:I am wondering if it is possible to add extra fields into the customer records?
Yes. Add a field to the database (ALTER TABLE customer_user) and reference that field in the Map of CustomerUser in Config.pm
If you're already using an alternate backend (LDAP, third party database, you can reference any field/attribute that is provided).
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
figozz
Znuny newbie
Posts: 7
Joined: 12 Oct 2012, 12:12
Znuny Version: 3.1.10
Real Name: Steve

Re: Add custom fields into "add customer" records

Post by figozz »

Thank you for your reply, but how do i edit the customer_user table? Thanks

Sorry, you have to assume I know nothing lol!
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

figozz wrote: how do i edit the customer_user table?
Read about ALTER TABLE in your database documentation. If you don't know what you're doing at this point, it's a bit out of scope to be able to walk you through something that you should have a good grasp of what it's doing, why, and how it works.

You need to connect to your mysql database with command line or MySQL WorkBench (download it if you don't know where it is) or phpmyadmin and add a field/column. But if you don't know what you're doing, you should really read the documentation and play around with a test database.
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
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

Re: Add custom fields into "add customer" records

Post by BrianYin »

i have a question about this. my OTRS using LDAP,but one attribute i need which value is none in LDAP.
is it possible i can modify OTRS database table customer_user by adding this attribute which has value.
such as i need "Department" in LDAP its value is empty, so i wanna add this attribute in OTRS database and let config.pm connect them both.
or any suggestions can solve my problem?
Thanks!
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

BrianYin wrote:i have a question about this. my OTRS using LDAP,but one attribute i need which value is none in LDAP.
is it possible i can modify OTRS database table customer_user by adding this attribute which has value.
such as i need "Department" in LDAP its value is empty, so i wanna add this attribute in OTRS database and let config.pm connect them both.
or any suggestions can solve my problem?
Thanks!
A CustomerUser Map relates to only one data source. You may have multiple data sources (back ends for CustomerUser), but the first one that effectively answers to your customerusername "wins", and all fields in that CustomerUser Map entry will be sought against that CustomerUser backend data source.
BrianYin wrote:one attribute i need which value is none in LDAP
Why is this? Department most certainly is a field in, for instance, Active Directory. If you don't have the field you seek in you LDAP source, you may wish to repurpose an unused field to hold the value you require, yet present it as "Department" in the CustomerUser Map.
BrianYin wrote:i wanna add this attribute in OTRS database and let config.pm connect them both.
You may certainly either extend LDAP Schema for this or OTRS Schema ... it doesn't make a practical difference on OTRS side as long as the attribute/column/field name exists in the data source to which CustomerUser connects.
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
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

Re: Add custom fields into "add customer" records

Post by BrianYin »

crythias wrote:
BrianYin wrote:i have a question about this. my OTRS using LDAP,but one attribute i need which value is none in LDAP.
is it possible i can modify OTRS database table customer_user by adding this attribute which has value.
such as i need "Department" in LDAP its value is empty, so i wanna add this attribute in OTRS database and let config.pm connect them both.
or any suggestions can solve my problem?
Thanks!
A CustomerUser Map relates to only one data source. You may have multiple data sources (back ends for CustomerUser), but the first one that effectively answers to your customerusername "wins", and all fields in that CustomerUser Map entry will be sought against that CustomerUser backend data source.
BrianYin wrote:one attribute i need which value is none in LDAP
Why is this? Department most certainly is a field in, for instance, Active Directory. If you don't have the field you seek in you LDAP source, you may wish to repurpose an unused field to hold the value you require, yet present it as "Department" in the CustomerUser Map.
BrianYin wrote:i wanna add this attribute in OTRS database and let config.pm connect them both.
You may certainly either extend LDAP Schema for this or OTRS Schema ... it doesn't make a practical difference on OTRS side as long as the attribute/column/field name exists in the data source to which CustomerUser connects.
Thanks, i see what you mean.
Department does exists in AD but its value is nearly empty. therefore i will create a table in database which has dapartment value
As your advice up there, i could set multiple data sources in CustomerUser Map. How can i do that?
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

BrianYin wrote:Department does exists in AD but its value is nearly empty. therefore i will create a table in database which has dapartment value
You should determine if you're going to use the customer_user table in your database OR ActiveDirectory/LDAP for CustomerUser information.
BrianYin wrote:As your advice up there, i could set multiple data sources in CustomerUser Map. How can i do that?
It's in the docs http://doc.otrs.org/3.1/en/html/custome ... ckend.html but remember ... you can pull data from only one backed per customer or user.
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
figozz
Znuny newbie
Posts: 7
Joined: 12 Oct 2012, 12:12
Znuny Version: 3.1.10
Real Name: Steve

Re: Add custom fields into "add customer" records

Post by figozz »

Ok I figured out how to define additional fields in the database and have added the map information into config.pm and all is working well.

One more question if I could.

Now that I have added extra information for customers I want to be able to display that information in "Customer Data" when I click on "Customer" from within a ticket. Anyone know how to do this at all please?

Or better still, rather than clutter that page with all the information, perhaps have a separate link from within the ticket which will open a full detail of the customer information?

Thanks.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

The information will populate TicketZoom Customer Information when/if the respective fields are filled.
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
figozz
Znuny newbie
Posts: 7
Joined: 12 Oct 2012, 12:12
Znuny Version: 3.1.10
Real Name: Steve

Re: Add custom fields into "add customer" records

Post by figozz »

Thanks, it does. I didnt actually check that the fields were populate and was an oversight on my part, sorry!

I have another question. Is it possible to use a pull down selection menu for fields in the "Add Customer" page (similar to how you select "Valid" options)

Like for instance >

Field: Business Type

Options:
Corporate / Franchise

Oh and also is it possible to auto populate default answers in the fields?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add custom fields into "add customer" records

Post by crythias »

figozz wrote: Is it possible to use a pull down selection menu for fields in the "Add Customer" page (similar to how you select "Valid" options)
Yes. Look at the example in Defaults.pm below/inside the CustomerUser section (Selections) and copy it to Config.pm
figozz wrote:Oh and also is it possible to auto populate default answers in the fields?
If you use Selections, and don't have an empty value, yes, I think. Otherwise, not really.
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
figozz
Znuny newbie
Posts: 7
Joined: 12 Oct 2012, 12:12
Znuny Version: 3.1.10
Real Name: Steve

Re: Add custom fields into "add customer" records

Post by figozz »

Thanks for this. Have managed to create drop down list field by adding the following into config.pm

Code: Select all

        Selections => {
            BusType => {
                'Pick from list...' => '',
                'Corporate' => 'Corporate',
                'Franchise' => 'Franchise',
            },
        },
As for default answer. I want a default text answer that is editable. For instance, email address will autopopulate as "admin@mybusiness.net" but I can change admin to anything I want should I wish to change the email address
joenova
Znuny newbie
Posts: 1
Joined: 18 Sep 2013, 01:51
Znuny Version: 3.2.10

Re: Add custom fields into "add customer" records

Post by joenova »

are you talking about the config.pm in the kernal folder? That one doesnt seem to have any mapping of database fields to the gui
Post Reply