Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong SLA is used (alphabetical order is ignored) #3871

Closed
martini opened this issue Nov 26, 2021 · 0 comments
Closed

Wrong SLA is used (alphabetical order is ignored) #3871

martini opened this issue Nov 26, 2021 · 0 comments

Comments

@martini
Copy link
Collaborator

martini commented Nov 26, 2021

Infos:

  • Used Zammad version: 5.0
  • Installation method (source, package, ..): any
  • Operating system: any
  • Database + version: any
  • Elasticsearch version: any
  • Browser + version: any
  • Ticket#: 1083475

Expected behavior:

  • use first matching SLA based on alphabetical order of SLA names

Actual behavior:

  • SLAs are not probed in alphabetical order. SLAs are probed ordered by id.

Steps to reproduce the behavior:

  • create SLA1 (select all states) with name ZZZ 1 and first response time within 2 hours
  • create SLA1 (select all states) with name AAA 1 and first response time within 5 hours
  • create a new emails by incoming email
  • open the ticket in Zammad and you will see that the first response time with 2 hours is use

Technical note:
Problem is here: https://github.com/zammad/zammad/blob/develop/app/models/sla.rb#L28 find_each will ignore the order method.

2.7.4 :002 > Sla.for_ticket(Ticket.last)
Scoped order is ignored, it's forced to be batch order.
 => #<Sla id: 1, calendar_id: 1, name: "ZZZ 1", first_response_time: 120, response_time: nil, update_time: nil, solution_time: nil, condition: {"ticket.state_id"=>{"operator"=>"is", "value"=>["5", "1", "2", "7", "3"]}}, updated_by_id: 3, created_by_id: 3, created_at: "2021-11-26 10:28:18", updated_at: "2021-11-26 10:30:36"> 
2.7.4 :003 > 

Regression of 1aa4e68

@martini martini added this to the 5.0.3 milestone Nov 26, 2021
@martini martini added this to To do in OLD Workflow via automation Nov 26, 2021
@martini martini changed the title Wrong SLA is used Wrong SLA is used (alphabetical order is ignored) Nov 26, 2021
@rolfschmidt rolfschmidt self-assigned this Nov 26, 2021
@rolfschmidt rolfschmidt moved this from To do to In progress in OLD Workflow Nov 26, 2021
@rolfschmidt rolfschmidt removed their assignment Nov 26, 2021
@rolfschmidt rolfschmidt moved this from In progress to To do in OLD Workflow Nov 26, 2021
@rolfschmidt rolfschmidt self-assigned this Nov 29, 2021
@rolfschmidt rolfschmidt moved this from To do to In progress in OLD Workflow Nov 29, 2021
@rolfschmidt rolfschmidt moved this from In progress to Backporting to stable in OLD Workflow Nov 30, 2021
@rolfschmidt rolfschmidt moved this from Backporting to stable to Done in OLD Workflow Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
OLD Workflow
  
Done
Development

No branches or pull requests

2 participants