[minor] fetched tickets to closed using sql instead of get_all
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index e5c6ee1..2798f70 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -81,10 +81,9 @@
 	st.save()
 
 def auto_close_tickets():
-	issues = frappe.db.get_all("Issue", filters={
-		"status": "Replied",
-		"modified": ("<", "date_sub(curdate(),interval 7 Day)")
-	}, fields=["name"])
+	""" auto close the replied support tickets after 7 days """
+	issues = frappe.db.sql(""" select name from tabIssue where status='Replied' and
+		modified<DATE_SUB(CURDATE(), INTERVAL 7 DAY) """, as_dict=True)
 
 	for issue in issues:
 		doc = frappe.get_doc("Issue", issue.get("name"))