OTRS 6 - How to get the customer id in the AgentTicketPhone Module?

English! place to talk about development, programming and coding
Post Reply
tbraemer
Znuny newbie
Posts: 5
Joined: 08 Jul 2020, 14:15
Znuny Version: 6.0.25
Real Name: Brämer

OTRS 6 - How to get the customer id in the AgentTicketPhone Module?

Post by tbraemer »

Hey guys,

I need to write an extension to the AgentTicketPhone Module. I managed to do it in version 4 but here I'm failing somehow. My plan is to read out the customer ID that was selected by the agent and together with the customer information, show another widget with some additional information which I get using the customer ID in version 4 I just easily access it by $Ticket{CustomerID}. How can I get the CustomerID in version 6?

Regards,
Tilo
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: OTRS 6 - How to get the customer id in the AgentTicketPhone Module?

Post by zzz »

Hello Tilo,

If you need it on the Perl side, you get it from here.
The $CustomerUser variable holds the CustomerUserID and from there on you can get the CustomerID.

On the front end side, you get the CustomerID from the AJAX call with the headers "Action: AgentCustomerSearch, Subaction: CustomerInfo".

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
tbraemer
Znuny newbie
Posts: 5
Joined: 08 Jul 2020, 14:15
Znuny Version: 6.0.25
Real Name: Brämer

Re: OTRS 6 - How to get the customer id in the AgentTicketPhone Module?

Post by tbraemer »

Thanks Emi,

this didn't solve my problem directly because I had to read it out again and even then it only contained the email. But it pointed me in the right direction and I could programm a workaround and could finish my task.

It isn't an elegant solution but it works. Instead of delivering the info fields in datablocks like I used to do in v4 I basically hijacked an AJAX call, added my information and then did the rest of the work directly in javascript. :mrgreen:

Regards,
Tilo
Post Reply