diff --git a/src/dispatch/cli.py b/src/dispatch/cli.py index 95ae7d5a3f96..c8c676be1222 100644 --- a/src/dispatch/cli.py +++ b/src/dispatch/cli.py @@ -640,6 +640,8 @@ def dispatch_scheduler(): ) from .term.scheduled import sync_terms # noqa from .workflow.scheduled import sync_workflows # noqa + from .case.scheduled import case_triage_reminder # noqa + from .case.scheduled import case_close_reminder # noqa @dispatch_scheduler.command("list") diff --git a/src/dispatch/messaging/strings.py b/src/dispatch/messaging/strings.py index 0facbef81ce4..4ed67e78cf42 100644 --- a/src/dispatch/messaging/strings.py +++ b/src/dispatch/messaging/strings.py @@ -5,6 +5,7 @@ from dispatch.messaging.email.filters import env from dispatch.conversation.enums import ConversationButtonActions from dispatch.incident.enums import IncidentStatus +from dispatch.case.enums import CaseStatus from dispatch.enums import Visibility from dispatch import config @@ -34,6 +35,7 @@ class MessageType(DispatchEnum): incident_tactical_report = "incident-tactical-report" incident_task_list = "incident-task-list" incident_task_reminder = "incident-task-reminder" + case_status_reminder = "case-status-reminder" service_feedback = "service-feedback" @@ -43,6 +45,13 @@ class MessageType(DispatchEnum): IncidentStatus.closed: "This no longer requires additional involvement, long term incident action items have been assigned to their respective owners.", } +CASE_STATUS_DESCRIPTIONS = { + CaseStatus.new: "This case is new and needs triaging.", + CaseStatus.triage: "This case is being triaged.", + CaseStatus.escalated: "This case has been escalated.", + CaseStatus.closed: "This case has been closed.", +} + INCIDENT_VISIBILITY_DESCRIPTIONS = { Visibility.open: "We ask that you use your best judgment while sharing details about this incident outside of the dedicated channels of communication. Please reach out to the Incident Commander if you have any questions.", Visibility.restricted: "This incident is restricted to immediate participants of this incident. We ask that you exercise extra caution and discretion while talking about this incident outside of the dedicated channels of communication. Only invite new participants that are strictly necessary. Please reach out to the Incident Commander if you have any questions.", @@ -236,6 +245,16 @@ class MessageType(DispatchEnum): "\n", " " ).strip() +CASE_TRIAGE_REMINDER_DESCRIPTION = """The status of this case hasn't been updated recently. +Please ensure you triage the case based on it's priority.""".replace( + "\n", " " +).strip() + +CASE_CLOSE_REMINDER_DESCRIPTION = """The status of this case hasn't been updated recently. +You can use case 'Resolve' button if it has been resolved and can be closed.""".replace( + "\n", " " +).strip() + INCIDENT_TASK_NEW_DESCRIPTION = """ The following incident task has been created and assigned to you by {{task_creator}}: {{task_description}}""" @@ -390,6 +409,14 @@ class MessageType(DispatchEnum): INCIDENT_TITLE = {"title": "Title", "text": "{{title}}"} +CASE_TITLE = {"title": "Title", "text": "{{title}}"} + +CASE_STATUS = { + "title": "Status - {{status}}", + "status_mapping": CASE_STATUS_DESCRIPTIONS, +} + + if config.DISPATCH_MARKDOWN_IN_INCIDENT_DESC: INCIDENT_DESCRIPTION = {"title": "Description", "text": "{{description | markdown}}"} else: @@ -596,6 +623,28 @@ class MessageType(DispatchEnum): INCIDENT_STATUS, ] + +CASE_CLOSE_REMINDER = [ + { + "title": "{{name}} Case - Close Reminder", + "title_link": "{{ticket_weblink}}", + "text": CASE_CLOSE_REMINDER_DESCRIPTION, + }, + CASE_TITLE, + CASE_STATUS, +] + +CASE_TRIAGE_REMINDER = [ + { + "title": "{{name}} Case - Triage Reminder", + "title_link": "{{ticket_weblink}}", + "text": CASE_TRIAGE_REMINDER_DESCRIPTION, + }, + CASE_TITLE, + CASE_STATUS, +] + + INCIDENT_TASK_REMINDER = [ {"title": "Incident - {{ name }}", "text": "{{ title }}"}, {"title": "Creator", "text": "{{ creator }}"},