OTRS export to csv customer information

Moderator: crythias

Post Reply
Volverine87
Znuny newbie
Posts: 40
Joined: 14 Nov 2017, 15:19
Znuny Version: OTRS 5.0.20
Real Name: Rafal
Company: UKWSL

OTRS export to csv customer information

Post by Volverine87 »

Hi,
I need some help with the code if anyone can help me it would be great!

I want pull report that will give me "email" field but I believe its been classified under CustomerUser data
I know how to add all information from Ticket Sections: Like Queue, State, Type, created time, etc.

My code look like this:

" my %Ticket = $Kernel::OM->Get('Kernel::System::Ticket')->TicketGet( TicketID => $Vote->{TicketID} );
my %User = $Kernel::OM->Get('Kernel::System::CustomerUser')->CustomerUserDataGet( CustomerUserID => $Vote->{CustomerUserID} );
push @Data, $Vote->{SendTime};
push @Data, $Vote->{VoteTime};
push @Data, $Ticket{Queue};
push @Data, "#".$Ticket{TicketNumber};
push @Data, $Ticket{Owner};
push @Data, $Ticket{CustomerUserID}; "

Whatever I will add under: push @Data, $Ticket{...}; - will be exported but if I add field push @Data, $CustomerUserID it coming with error that I didn't specify my

Can someone help what I should write in code in second line starting my %user?
and is in line number 8 I should type : push @Data, $User{Email}; to have my desired result??


This is the Error log:

An error occurred.


Global symbol "%CustomerUser" requires explicit package name (did you forget to declare "my %CustomerUser"?) at /opt/otrs//Kernel/Modules/AgentSurveyExport.pm line 65.

Please contact the administrator.


Really a bug? 5 out of 10 bug reports result from a wrong or incomplete installation of OTRS. With OTRS Business Solution™, our experts take care of correct installation and cover your back with support and periodic security updates.

Contact our service team now.

Message:
Global symbol "%CustomerUser" requires explicit package name (did you forget to declare "my %CustomerUser"?) at /opt/otrs//Kernel/Modules/AgentSurveyExport.pm line 65.


Comment:
Please contact the administrator.

Traceback:
ERROR: OTRS-CGI-10 Perl: 5.22.1 OS: linux Time: Mon Mar 26 16:15:37 2018

Message: Global symbol "%CustomerUser" requires explicit package name (did you forget to declare "my %CustomerUser"?) at /opt/otrs//Kernel/Modules/AgentSurveyExport.pm line 65.


RemoteAddress: 0.0.0.0
RequestURI: /otrs/index.pl?Action=AgentSurveyExport;SurveyID=3

Traceback (8467):
Module: Kernel::System::Web::InterfaceAgent::Run Line: 196
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32



Send a bugreport or go back to the previous page


Error Details:





Error Details

Backend ERROR: OTRS-CGI-10 Perl: 5.22.1 OS: linux Time: Mon Mar 26 16:15:37 2018

Message: Global symbol "%CustomerUser" requires explicit package name (did you forget to declare "my %CustomerUser"?) at /opt/otrs//Kernel/Modules/AgentSurveyExport.pm line 65.


RemoteAddress: 0.0.0.0
RequestURI: /otrs/index.pl?Action=AgentSurveyExport;SurveyID=3

Traceback (8467):
Module: Kernel::System::Web::InterfaceAgent::Run Line: 196
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32



Powered by OTRS
Switch to desktop mode




Your browser was not able to communicate with OTRS properly, there seems to be something wrong with your network connection. You could either try reloading this page manually or wait until your browser has re-established the connection on its own.
Thank you
You do not have the required permissions to view the files attached to this post.
Volverine87
Znuny newbie
Posts: 40
Joined: 14 Nov 2017, 15:19
Znuny Version: OTRS 5.0.20
Real Name: Rafal
Company: UKWSL

Re: OTRS export to csv customer information

Post by Volverine87 »

Hi All,

I know the first message might not look very clean so I done a lot research and I think I'm nearly there but I'm missing dependent object:

I know I can use:
my %CustomerUser = $Kernel::OM->Get('Kernel::System::CustomerUser')->CustomerUserDataGet
push @Data, $CustomerUser{UserLogin, etc...};
get user data (UserLogin, UserFirstname, UserLastname, UserEmail, ...)
my %User = $CustomerUserObject->CustomerUserDataGet(
User => 'franz',
);
or I should use:
=item GetUserData()

get user data (UserLogin, UserFirstname, UserLastname, UserEmail, ...)

my %User = $UserObject->GetUserData(
UserID => 123,
);
my %User = $UserObject->GetUserData(
User => 'franz',


In both scenario how I should specify that the record should search in current ticketID for field UserID that survey been send to and then print of my desired result with is UserName UserLastname and UserEmail as excel report ???
for Ticket I used :
my %Ticket = $Kernel::OM->Get('Kernel::System::Ticket')->TicketGet( TicketID => $Vote->{TicketID} );
How to use it with customerUser??

PS. Crythias maybe you know?
Post Reply