Accessing Queue or QueueId from TicketNumberGenerator

English! place to talk about development, programming and coding
Post Reply
zahmaci
Znuny newbie
Posts: 4
Joined: 28 Jan 2014, 16:33
Znuny Version: 3.3.3

Accessing Queue or QueueId from TicketNumberGenerator

Post by zahmaci »

Hi,
We want to create a new ticket number generator module. But we can not reach Queue or QueueID from
package Kernel::System::Ticket::Number::*; files.

Is there a way to get QueueID while new ticket number creating ?

I am attaching Dumper($Self->{QueueObject}->{CacheInternalObject}) from package Kernel::System::Ticket::Number::Random; below..
dumper.zip

Code: Select all

[Tue Jan 28 16:44:03 2014][Debug][Kernel::System::Ticket::Number::TgTicketNumber::TicketCreateNumber][140] $VAR1 = bless( {
                 'Cache' => {
                              'QueueGetID::7' => {
                                                 'FollowUpLock' => '0',
                                                 'ValidID' => '1',
                                                 'QueueID' => '7',
                                                 'RealName' => 'TEST',
                                                 'FirstResponseNotify' => '0',
                                                 'UpdateTime' => '0',
                                                 'Email' => 'TEST@TEST.com',
                                                 'ChangeTime' => '2013-12-25 10:23:34',
                                                 'UnlockTimeout' => '0',
                                                 'Calendar' => '',
                                                 'CreateTime' => '2013-12-25 10:23:34',
                                                 'Comment' => '',
                                                 'UpdateNotify' => '0',
                                                 'DefaultSignKey' => '',
                                                 'GroupID' => '2',
                                                 'SolutionTime' => '0',
                                                 'SolutionNotify' => '0',
                                                 'SystemAddressID' => '4',
                                                 'SalutationID' => '1',
                                                 'FollowUpID' => '1',
                                                 'SignatureID' => '1',
                                                 'Name' => 'TurboSMTPtest',
                                                 'FirstResponseTime' => '0'
                                               },
                              'QueueList::0' => {
                                                  '6' => 'sendgridtest',
                                                  '3' => 'Junk',
                                                  '7' => 'TurboSMTPtest',
                                                  '2' => 'Raw',
                                                  '8' => 'Test2',
                                                  '4' => 'Misc',
                                                  '1' => 'Postmaster',
                                                  '5' => 'postmarktest'
                                                }
                            },
              ..... you can see the rest from attachment
You do not have the required permissions to view the files attached to this post.
Last edited by zahmaci on 29 Jan 2014, 11:27, edited 2 times in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by crythias »

Why would you need to do this? Are you going to create individual numbers for every queue that the ticket sits in?
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
zahmaci
Znuny newbie
Posts: 4
Joined: 28 Jan 2014, 16:33
Znuny Version: 3.3.3

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by zahmaci »

crythias wrote:Why would you need to do this? Are you going to create individual numbers for every queue that the ticket sits in?
Exactly, i want to create different Ticket Numbers for different queues ...

Have you got an idea ?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by crythias »

zahmaci wrote:Exactly, i want to create different Ticket Numbers for different queues ...
zahmaci wrote:Have you got an idea ?
Don't do this. You will hurt yourself.
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
zahmaci
Znuny newbie
Posts: 4
Joined: 28 Jan 2014, 16:33
Znuny Version: 3.3.3

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by zahmaci »

crythias wrote:
zahmaci wrote:Exactly, i want to create different Ticket Numbers for different queues ...
zahmaci wrote:Have you got an idea ?
Don't do this. You will hurt yourself.
Thank you for your reply, but could you provide Pros and Cons about this topic ?
I think it will help some one a lot (including me)

And on the other hand, i understand that i can reach QueueID from Ticketnumbergenerator function (according to your comment), How can i do that without editing core files ?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by crythias »

zahmaci wrote:How can i do that without editing core files ?
Whatever you do in your own TNG is up to you.
zahmaci wrote:could you provide Pros and Cons about this topic ?
Con: Ticket numbers are agnostic to the ticket's content. It is a pointer to the ticket no matter what queue or state or flag or ... anything else that's attached to the ticket.
Once you choose to include a part of the ticket in the ticket number, you have to account for that each time you handle the ticket. And, generally, you can't change that attribute of the ticket without figuring out how to either ignore that part of the ticket number or directly referencing the ticket number in some way for every iteration of that ticket attribute that you have to include in the ticket number.

What happens if you change the ticket's queue?

If you're using customer based queues, don't do that.
If you want to include the queue in correspondence (why? it's not for the customer's benefit what queue the ticket is in) you can add that field in the body of the ticket.

The queue has very little relevance to actually getting the ticket solved (No, you say, it's a high priority/VIP Queue!) So, figure out another way to designate this. For instance, Admin, Agent Notifications, Agent::NewTicket or Agent::Followup <OTRS_TICKET_Queue> in subject
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
zahmaci
Znuny newbie
Posts: 4
Joined: 28 Jan 2014, 16:33
Znuny Version: 3.3.3

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by zahmaci »

Ok i understand your thoughts.

And let me explain why we want to do with this way.

Our customer is working as a Callcenter, and they have more than one customers. One of selling holidays the other one selling a simple software. And they have dedicated agents who replies incoming emails from different customer's customers.
So actually each Queue belongs to different company and they want to create different ticket numbers for different companies (queues)

Ex:
- MYHLDY010101555 (For travel agency)
- PDFEXPRT201401290001 (For software company)

and the queues never and ever connected to each others.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Accessing Queue or QueueId from TicketNumberGenerator

Post by crythias »

I don't fully understand your role in this, but I assume you're hosting a single instance of OTRS for multiple companies to use?

My suggestion would be multiple OTRS installs and change the TicketHook per install (and per-install SystemID).

I'm sure it makes sense to you what you're doing. I've provided a way for you to include the queue in the Notification emails, and that it's not so relevant to customers.

I can't give you more information than this at this point, so I'm going to leave this conversation. Maybe someone else can help you.
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
Post Reply