Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/dispatch/case/scheduled.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
from datetime import datetime, date
from schedule import every
from sqlalchemy.orm import Session
from sqlalchemy import or_

from dispatch.decorators import scheduled_project_task, timer
from dispatch.project.models import Project
from dispatch.scheduler import scheduler

from .enums import CaseStatus
from .messaging import send_case_close_reminder, send_case_triage_reminder
from .models import Case
from .service import (
get_all_by_status,
)
Expand All @@ -31,7 +33,9 @@
def case_close_reminder(db_session: Session, project: Project):
"""Sends a reminder to the case assignee to close out their case."""
cases = get_all_by_status(
db_session=db_session, project_id=project.id, statuses=[CaseStatus.triage]
db_session=db_session,
project_id=project.id,
statuses=[CaseStatus.triage]
)

for case in cases:
Expand All @@ -52,8 +56,17 @@ def case_close_reminder(db_session: Session, project: Project):
@scheduled_project_task
def case_triage_reminder(db_session: Session, project: Project):
"""Sends a reminder to the case assignee to triage their case."""
cases = get_all_by_status(
db_session=db_session, project_id=project.id, statuses=[CaseStatus.new]

cases = (
db_session.query(Case)
.filter(Case.project_id == project.id)
.filter(
or_(
Case.title == "Security Event Triage",
Case.status == CaseStatus.new
)
)
.all()
)

# if we want more specific SLA reminders, we would need to add additional data model
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/messaging/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class MessageType(DispatchEnum):
).strip()

CASE_TRIAGE_REMINDER_DESCRIPTION = """The status of this case hasn't been updated recently.
Please ensure you triage the case based on its priority.""".replace(
Please ensure you triage the case based on its priority and update its title, priority, severity and tags.""".replace(
"\n", " "
).strip()

Expand Down
Loading