From d7cd5b57cc344b305cd17205bcd28a6809fea883 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 12 Oct 2015 16:07:21 +0200 Subject: [PATCH] Ignore created ticket in state closed. --- lib/stats/ticket_reopen.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/stats/ticket_reopen.rb b/lib/stats/ticket_reopen.rb index 395d9e178..7b7990df1 100644 --- a/lib/stats/ticket_reopen.rb +++ b/lib/stats/ticket_reopen.rb @@ -70,7 +70,13 @@ class Stats::TicketReopen # check if close_time is already set / if not, ticket is not reopend return if !ticket.close_time + # only if state id has changed return if !changes['state_id'] + + # only if ticket is not created in closed state + return if !changes['state_id'][0] + + # only if current owner is not 1 return if ticket.owner_id == 1 state_before = Ticket::State.lookup(id: changes['state_id'][0])