From da5be333d9539c6b441ecabef9767eb102412baf Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 18 Oct 2021 08:22:14 +0200 Subject: [PATCH] fix(osticket): don't show resolved tickets by other deparments --- print/templates/email/osticket-report/sql/tickets.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/print/templates/email/osticket-report/sql/tickets.sql b/print/templates/email/osticket-report/sql/tickets.sql index 7cb35aaab..50b15473d 100644 --- a/print/templates/email/osticket-report/sql/tickets.sql +++ b/print/templates/email/osticket-report/sql/tickets.sql @@ -9,6 +9,7 @@ SELECT * FROM ( ote.body AS description, oter.body AS resolution FROM ost_ticket ot + JOIN ost_department od ON od.id = ot.dept_id JOIN ost_ticket__cdata otc ON ot.ticket_id = otc.ticket_id JOIN ost_ticket_status ots ON ot.status_id = ots.id JOIN ost_user otu ON ot.user_id = otu.id @@ -20,8 +21,9 @@ SELECT * FROM ( LEFT JOIN ost_thread_entry oter ON oth.id = oter.thread_id AND oter.type = 'R' WHERE ot.ticket_pid IS NULL - AND ots.state = 'closed' AND ot.closed BETWEEN ? AND ? + AND ots.state = 'closed' + AND od.code = 'IT' ORDER BY oter.created DESC ) ot GROUP BY ot.ticket_id ORDER BY ot.assigned \ No newline at end of file