
Hello, I'm trying to write my own module in order to make a different queueview. I have a simple question to the function TicketSearch. I wan't to get all tickets from a customer should't this be correct: @ViewableTickets = $Self->{TicketObject}->TicketSearch( Result => 'ARRAY', Limit => 100, CustomerID => 'Customer A/S', StateIDs => [1,2,3,4,5,6,7,8,9], ); Thing is it doesn't work i can only get tickets out if i specify: CustomerUserID => 'loginname', CustomerID seems to have no effect. But i do not wish to do this since i have multiple logins for one customer and only specifying the user won't give me all tickets from that customer. regards, Simon

Hi Simon, Simon A. F. Lund wrote:
I'm trying to write my own module in order to make a different queueview. I have a simple question to the function TicketSearch. I wan't to get all tickets from a customer should't this be correct:
@ViewableTickets = $Self->{TicketObject}->TicketSearch( Result => 'ARRAY', Limit => 100, CustomerID => 'Customer A/S', StateIDs => [1,2,3,4,5,6,7,8,9], );
Thing is it doesn't work i can only get tickets out if i specify: CustomerUserID => 'loginname', CustomerID seems to have no effect.
But i do not wish to do this since i have multiple logins for one customer and only specifying the user won't give me all tickets from that customer.
CustomerID as STRING or as ARRAY sould work fine. But if you use PostgeSQL and OTRS 1.3 the CustomerID is casesensitiv. Anyway, you also need to add UserID => $Self->{UserID}, because TicketSearch() need to know what user is looking for tickets.
regards, Simon
Martin -- ((otrs)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

Thx for the reply! It works just fine now. I would also like to get a list of all the customers, i've tried with CustomerIDs but all i get there is customer logins. I need the actual CustomerIDs. The one from `customer_id`. Which function can i use? Btw why is aren't there a table called `customers` where you could store the customers and let the customer_user.customer_id have a reference to this table? This is great when you integrate otrs with other software like CRM systems. Plus you could add some info about the customer (the address of the firm. primary contact, etc. ) and let the info in customer_user only be about the actual user. regards, safl Martin Edenhofer wrote:
Hi Simon,
Simon A. F. Lund wrote:
I'm trying to write my own module in order to make a different queueview. I have a simple question to the function TicketSearch. I wan't to get all tickets from a customer should't this be correct:
@ViewableTickets = $Self->{TicketObject}->TicketSearch( Result => 'ARRAY', Limit => 100, CustomerID => 'Customer A/S', StateIDs => [1,2,3,4,5,6,7,8,9], );
Thing is it doesn't work i can only get tickets out if i specify: CustomerUserID => 'loginname', CustomerID seems to have no effect.
But i do not wish to do this since i have multiple logins for one customer and only specifying the user won't give me all tickets from that customer.
CustomerID as STRING or as ARRAY sould work fine. But if you use PostgeSQL and OTRS 1.3 the CustomerID is casesensitiv.
Anyway, you also need to add
UserID => $Self->{UserID},
because TicketSearch() need to know what user is looking for tickets.
regards, Simon
Martin
-- ((otrs)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
_______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Hi Simon, Simon A. F. Lund wrote:
Thx for the reply! It works just fine now.
Fine!
I would also like to get a list of all the customers, i've tried with CustomerIDs but all i get there is customer logins. I need the actual CustomerIDs. The one from `customer_id`. Which function can i use?
There is no function to get all uniq CustomerIDs from the ticket table. Because customer_id and customer_user_id is just a link to a customer source (db backend, ldap backend or other backends).
Btw why is aren't there a table called `customers` where you could store the customers and let the customer_user.customer_id have a reference to this table? This is great when you integrate otrs with other software like CRM systems. Plus you could add some info about the customer (the address of the firm. primary contact, etc. ) and let the info in customer_user only be about the actual user.
It's because we want also to support different customer backends (DB, LDAP, SAP, ...). But anyway, if you have a good idea/patch, feel free to discuss it. :-)
safl
Martin -- ((otrs)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

Hi, I wrote a small function selecting DISTINCT customer_id. It works just fine. I've written a module called "AgentTicketOverView.pm", now i want to replace QueueView as the default view when an Agent logs into OTRS. How? Can this be done by config or can change something simple in Interface.pm or index.pl? I really appreciate the help so far! regards, Simon Martin Edenhofer wrote:
Hi Simon,
Simon A. F. Lund wrote:
Thx for the reply! It works just fine now.
Fine!
I would also like to get a list of all the customers, i've tried with CustomerIDs but all i get there is customer logins. I need the actual CustomerIDs. The one from `customer_id`. Which function can i use?
There is no function to get all uniq CustomerIDs from the ticket table. Because customer_id and customer_user_id is just a link to a customer source (db backend, ldap backend or other backends).
Btw why is aren't there a table called `customers` where you could store the customers and let the customer_user.customer_id have a reference to this table? This is great when you integrate otrs with other software like CRM systems. Plus you could add some info about the customer (the address of the firm. primary contact, etc. ) and let the info in customer_user only be about the actual user.
It's because we want also to support different customer backends (DB, LDAP, SAP, ...).
But anyway, if you have a good idea/patch, feel free to discuss it. :-)
safl
Martin
-- ((otrs)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
_______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Hi Simon, Simon A. F. Lund wrote:
I wrote a small function selecting DISTINCT customer_id. It works just fine. I've written a module called "AgentTicketOverView.pm", now i want to replace QueueView as the default view when an Agent logs into OTRS. How? Can this be done by config or can change something simple in Interface.pm or index.pl? I really appreciate the help so far!
Which version? OTRS 2.0: You can use the new SysConfig. Admin-Interface -> Ticket -> Frontend::Agent -> Frontend::CommonParam###Action is set to AgentTicketQueue. Change it with your new default module. OTRS 1.x: You need to edit the file: Kernel/Config/Modules.pm [...] # -- # common needed params # (so you can access this params in Kernel::Modules::* with # $Self->{Key}) # -- $Kernel::Config::Modules::Param = { # param => default value Action => 'AgentQueueView', QueueID => 0, TicketID => '', }; [...]
Simon
Martin -- ((otrs)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
participants (2)
-
Martin Edenhofer
-
Simon A. F. Lund