znuny / Znuny

Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
https://www.znuny.org
GNU General Public License v3.0
355 stars 85 forks source link

Bug - Incomplete amount of articles on TicketGet with multiple TicketID's #16

Closed tonobo closed 3 years ago

tonobo commented 3 years ago

Expected behavior

The ArticleLimit should be applied per Ticket

Actual behavior

When passing multiple TicketIDs via SOAP in TicketGet request in addtion with an ArticleLimit, then the article limit seems to be overwritten in TicketGet loop.

I guess that's the reason for it: https://github.com/znuny/Znuny/blob/rel-6_0/Kernel/GenericInterface/Operation/Ticket/TicketGet.pm#L429

Sample Request:

      <TicketID>5299059</TicketID>
      <TicketID>5243571</TicketID>
      <Limit>2</Limit>
      <AllArticles>1</AllArticles>
      <ArticleLimit>100</ArticleLimit>

How to reprocude

Insert 2 ticket with different amount of articles. Assume ticket 1 has 12 articles and 2 has only 7.

Query: TicketGet[1, 2] => articles: {1 => 7, 2 => 7} Query: TicketGet[1] => articles: {1 => 12} Query: TicketGet[2] => articles: {1 => 7}

Environment

rkaldung commented 3 years ago

Hello @tonobo, I'll validate this on a vanilla system and get back to you.

reneeb commented 3 years ago

@rkaldung I can confirm this behaviour. I can provide a simple patch in a few minutes...

rkaldung commented 3 years ago

@reneeb Thanks, I can confirm this too

reneeb commented 3 years ago

Or to be more clear: It depends on the order of the requested TicketIDs. In the case described above, everything is ok as the ticket with more articles is requested first. But all tickets requested after the ticket with less articles will show the lower bounds:

So ticket 1: 12 articles ticket 2: 7 articles

Request 1: ArticleLimit: 100, TicketIDs: [1,2] --> everything is ok Request 2: ArticleLimit: 100, TicketIDs: [2, 1] --> Ticket 1 shows only 7 articles

tonobo commented 3 years ago

Nice. :+1:

jepf commented 3 years ago

@tonobo @reneeb

Thank you very much. The fix from @reneeb will be part of release 6.0.33.

dennykorsukewitz commented 3 years ago

Fixed in rel-6_0_33.