chore: sequence id search in the issue search (#3807)

This commit is contained in:
Bavisetti Narayan 2024-02-27 16:55:00 +05:30 committed by GitHub
parent 58e0170cac
commit aba170dbde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,11 +9,11 @@ from plane.db.models import Issue
def search_issues(query, queryset):
fields = ["name", "sequence_id"]
fields = ["name", "sequence_id", "project__identifier"]
q = Q()
for field in fields:
if field == "sequence_id" and len(query) <= 20:
sequences = re.findall(r"[A-Za-z0-9]{1,12}-\d+", query)
sequences = re.findall(r"\b\d+\b", query)
for sequence_id in sequences:
q |= Q(**{"sequence_id": sequence_id})
else: