[SOLVED]how can i add attribute in config.pm into database

Moderator: crythias

Post Reply
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

[SOLVED]how can i add attribute in config.pm into database

Post by BrianYin »

HI, everyone
i want to add a table which shows the relationship between ticket and customers' departments , how can i do that, save the data from Active Directory into database table.
Thanks.
Last edited by BrianYin on 24 Oct 2012, 04:57, edited 2 times in total.
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
choenig
Znuny newbie
Posts: 36
Joined: 28 Sep 2012, 11:26
Znuny Version: 3.1.10
Location: 49° 54′ N, 10° 54′ O

Re: how can i add attribute in config.pm into database

Post by choenig »

Hi,

the only way is to create a new class in general catalogue and add its definition.
After that, you can use import/export functionality of OTRS and link tickets and customer departments.

Greetings
OTRS 3.2.8 - KIX4OTRS - ConfigureCallHome - ZnunyCustomerMap - running on CentOS 6.4 and MySQL
anyone who finds clerical errors can keep it...
BrianYin
Znuny newbie
Posts: 76
Joined: 29 Aug 2012, 10:12
Znuny Version: 3.1.12

Re: how can i add attribute in config.pm into database

Post by BrianYin »

choenig wrote:Hi,

the only way is to create a new class in general catalogue and add its definition.
After that, you can use import/export functionality of OTRS and link tickets and customer departments.

Greetings
how can i link these two, you mean i creat a dapartment field in the ticket creatation page, let agent fill it? right?
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
choenig
Znuny newbie
Posts: 36
Joined: 28 Sep 2012, 11:26
Znuny Version: 3.1.10
Location: 49° 54′ N, 10° 54′ O

Re: how can i add attribute in config.pm into database

Post by choenig »

you have to use the addon OTRS::ITSM. With it you are able to "link" e.g. any type of Hardware or in your case individual items with tickets, customers ...
Take a look at the admin manual of OTRS:ITSM: http://doc.otrs.org/itsm/2.0/en/html/
OTRS 3.2.8 - KIX4OTRS - ConfigureCallHome - ZnunyCustomerMap - running on CentOS 6.4 and MySQL
anyone who finds clerical errors can keep it...
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: how can i add attribute in config.pm into database

Post by crythias »

BrianYin wrote:i want to add a table which shows the relationship between ticket and customers' departments
Why bother creating a table for this? You know who the customer is from the ticket. The customer source should have the department. If you need a direct correlation of department to ticket, use a mandatory ticket dynamic field that lists departments.
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: how can i add attribute in config.pm into database

Post by BrianYin »

crythias wrote:
BrianYin wrote:i want to add a table which shows the relationship between ticket and customers' departments
Why bother creating a table for this? You know who the customer is from the ticket. The customer source should have the department. If you need a direct correlation of department to ticket, use a mandatory ticket dynamic field that lists departments.
yes, the customer information shows the department, thanks for your advice, if i put a mandatory ticket dynamic field it will bring agents more work to do~
so i was wondering the system can show customers' information, can it be saved? how can i do that? is there any connection with LDAP and local database.
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: how can i add attribute in config.pm into database

Post by crythias »

BrianYin wrote:so i was wondering the system can show customers' information, can it be saved?
There are various options but none really nice.
BrianYin wrote:how can i do that?
copy/paste.
BrianYin wrote:is there any connection with LDAP and local database.
No. the only customer information stored with a ticket is the login and customer_id.

But if I were going to make it a bit easier ..., I'd hyperlink the department to populate the dynamic field that stores it.

oh. I don't know something like ... viewtopic.php?f=60&t=7787
where http-link might be

Code: Select all

 [ 'UserDepartment',      'Department',   'department',      1, 1, 'var', '#" onclick="document.getElementById(\'DynamicField_department\').value=this.getAttribute(\'innerHTML\');', 0 ],
(something like, anyway)... I mean yes, the department field might be mandatory, but that doesn't mean you actually have to type anything...

But of course, this doesn't fix anything retroactively, but you may consider either querying via api or doing some retroactive storing.

Or, some sort of department based queues.
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: how can i add attribute in config.pm into database

Post by BrianYin »

crythias wrote: where http-link might be

Code: Select all

 [ 'UserDepartment',      'Department',   'department',      1, 1, 'var', '#" onclick="document.getElementById(\'DynamicField_department\').value=this.getAttribute(\'innerHTML\');', 0 ],
Really appreciate your help, i tried this code, but the department showed 'null'. why is that?
does it matter department is not english?

crythias: edited department to terminate apostrophe.
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: how can i add attribute in config.pm into database

Post by crythias »

BrianYin wrote:
crythias wrote: where http-link might be

Code: Select all

 [ 'UserDepartment',      'Department',   'department',      1, 1, 'var', '#" onclick="document.getElementById(\'DynamicField_department\').value=this.getAttribute(\'innerHTML\');', 0 ],
Really appreciate your help, i tried this code, but the department showed 'null'. why is that?
does it matter department is not english?
I tried it outside of otrs and it worked for me, I guess there's something it didn't get when implemented this way. play around with javascript in another environment. (copy source to a text file and test it out. ) Yeah, maybe it could be a problem with Chinese.You can also use Generic Agent to push the values.

Department based queues may also help. I don't really like this method, but it is attached as attribute for ticket.
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: how can i add attribute in config.pm into database

Post by crythias »

BrianYin, why aren't you using the department as your CustomerID?
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: how can i add attribute in config.pm into database

Post by BrianYin »

crythias wrote:BrianYin, why aren't you using the department as your CustomerID?
Brilliant!!
i changed a littte: remove getAttribute(),it worked. Thanks for all the help. Appreciate it!!
OTRS Version: 3.1.9
OS: windows 2003
ITSM 3.1.6
MySQL 5.xxx
Post Reply