TicketZoom - Article order by create Date

Moderator: crythias

Post Reply
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

TicketZoom - Article order by create Date

Post by DaSto »

Good Evening,

we are challenging a Problem for a few weeks now. We have a Webservice as an Interface which is inserting articles for a specific Ticket. Everything works fine but in TicketZoom the Articles are in the wrong order. I wanted to change the default sort to be sorted by Date not by Article Number. How can i achieve that?

As Attachment i have two screenshots - the first one is sorted by Number "1,2,3" but it's not correct when you look on the date.
standard_order-wrong.JPG
The other is sorted by Date and would be correct but you can see the order of the Numbers changed to "1,3,2".
correct_order.JPG
Thanks for any information.
You do not have the required permissions to view the files attached to this post.
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: TicketZoom - Article order by create Date

Post by lido »

Hi,

I don't think that's possible without editing core source files. I would assume it can probably be done by editing /Kernel/Modules/AgentTicketZoom.pm and/or /Kernel/Output/HTML/Templates/Standard/AgentTicketZoom.tt

But I'm not sure that should even be happening, because I would assume that the article number is added automatically and in sequence, so it should match the chronological order in which the articles get created. But I'm not an OTRS dev so I'm not 100% sure about this.

Does the webservice interface you're using to add articles also send any kind of date as a parameter?
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

Re: TicketZoom - Article order by create Date

Post by DaSto »

I thought that too but i can't find any numbers in the Database (1,2,3) - just the Dates so i guess the PM Files or JS or whatever are generating them.

We just do a simple MySql "INSERT" Statement in our Service. Containing every ID, Text and Dates the Table Article is asking for.
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

Re: TicketZoom - Article order by create Date

Post by DaSto »

I guess i found the Problem but have to Test it - in UI the DateTime of "creation" per article is shown with time. In the DB create_time and change_time
is only a Date but with Time "00:00:00". So that would change the order of articles in TicketZoom. I will change the times and will see if that helps.

Maybe our service is just inserting the Date so it takes standard time ZERO.
DaSto
Znuny newbie
Posts: 28
Joined: 22 May 2015, 08:32
Znuny Version: 5.0.25
Real Name: David Stockinger

Re: TicketZoom - Article order by create Date

Post by DaSto »

That was the SOLUTION but still confusing. The DateTime shown in TicketZoom is the field "incoming_time" in the table "Article" but the Articles are sorted by "create_time" or "change_time". Why would you show time by an integer field filled with datetime in ticks but sort it by another field?


So - thread can be closed for me!
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: TicketZoom - Article order by create Date

Post by lido »

Instead of inserting directly into MySQL, maybe you should try to use one of OTRS' available webservice connectors (SOAP or REST) to create the ticket.

See the docs and/or examples.
Post Reply