From f43e0474a7d35bc59d64c06ed140d7ad4821bdbf Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Mon, 3 Feb 2025 20:59:39 +0000 Subject: [PATCH 1/3] Issue #1235 - Escalation only notify users --- .../management/commands/escalate_tickets.py | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/helpdesk/management/commands/escalate_tickets.py b/helpdesk/management/commands/escalate_tickets.py index bfeba548..cc9e5458 100644 --- a/helpdesk/management/commands/escalate_tickets.py +++ b/helpdesk/management/commands/escalate_tickets.py @@ -33,9 +33,17 @@ class Command(BaseCommand): default=False, help='Display escalated tickets' ) + parser.add_argument( + '-n', + '--notify-only', + action='store_true', + default=False, + help='Send email reminder but dont escalate tickets' + ) def handle(self, *args, **options): verbose = options['escalate_verbosely'] + notify_only = options['notify_only'] queue_slugs = options['queues'] # Only include queues with escalation configured @@ -87,14 +95,15 @@ class Command(BaseCommand): if verbose: self.stdout.write(f" - Esclating {ticket.ticket} from {ticket.priority + 1}>{ticket.priority}") - followup = ticket.followup_set.create( - title=_('Ticket Escalated'), - public=True, - comment=_('Ticket escalated after %(nb)s days') % {'nb': queue.escalate_days}, - ) + if not notify_only: + followup = ticket.followup_set.create( + title=_('Ticket Escalated'), + public=True, + comment=_('Ticket escalated after %(nb)s days') % {'nb': queue.escalate_days}, + ) - followup.ticketchange_set.create( - field=_('Priority'), - old_value=ticket.priority + 1, - new_value=ticket.priority, - ) + followup.ticketchange_set.create( + field=_('Priority'), + old_value=ticket.priority + 1, + new_value=ticket.priority, + ) From b7a88d8305dccd6f9abebf53063d8b9407a2809a Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Sat, 8 Mar 2025 00:38:50 +0000 Subject: [PATCH 2/3] adding documentation for escalate_tickets --notify-only --- docs/configuration.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 3491c27a..72bbef7b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -42,15 +42,19 @@ Before django-helpdesk will be much use, you need to do some basic configuration This will, on a weekly basis, create exclusions for the coming weekend. -6. Log in to your Django admin screen, and go to the 'Sites' module. If the site ``example.com`` is listed, click it and update the details so they are relevant for your website. +6. To notify users of outstanding tickets without adding an entry to the ticket, use the --notify-only flag. This will send the emails without creating a follow-up:: -7. If you do not send mail directly from your web server (eg, you need to use an SMTP server) then edit your ``settings.py`` file so it contains your mail server details:: + 0 0 * * 0 /path/to/helpdesksite/manage.py escalate_tickets --notify-only + +7. Log in to your Django admin screen, and go to the 'Sites' module. If the site ``example.com`` is listed, click it and update the details so they are relevant for your website. + +8. If you do not send mail directly from your web server (eg, you need to use an SMTP server) then edit your ``settings.py`` file so it contains your mail server details:: EMAIL_HOST = 'XXXXX' EMAIL_HOST_USER = 'YYYYYY@ZZZZ.PPP' EMAIL_HOST_PASSWORD = '123456' -8. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know `_. +9. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know `_. You're now up and running! Happy ticketing. From 61e06b154c6a4e84265041eded100cd09f019776 Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Mon, 10 Mar 2025 21:46:19 +0000 Subject: [PATCH 3/3] Documentation improvements for notify-only --- docs/configuration.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 72bbef7b..9cc30d7a 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -36,25 +36,25 @@ Before django-helpdesk will be much use, you need to do some basic configuration This will run the escalation process hourly, using the 'Escalation Days' setting for each queue to determine which tickets to escalate. + To notify users of outstanding tickets without adding an entry to the ticket, use the `notify-only` flag. This will send the emails without creating a follow-up:: + + 0 * * * * /path/to/helpdesksite/manage.py escalate_tickets --notify-only + 5. If you wish to exclude some days (eg, weekends) from escalation calculations, enter the dates manually via the Admin, or setup a cronjob to run a management command on a regular basis:: 0 0 * * 0 /path/to/helpdesksite/manage.py create_escalation_exclusions --days saturday sunday This will, on a weekly basis, create exclusions for the coming weekend. -6. To notify users of outstanding tickets without adding an entry to the ticket, use the --notify-only flag. This will send the emails without creating a follow-up:: +6. Log in to your Django admin screen, and go to the 'Sites' module. If the site ``example.com`` is listed, click it and update the details so they are relevant for your website. - 0 0 * * 0 /path/to/helpdesksite/manage.py escalate_tickets --notify-only - -7. Log in to your Django admin screen, and go to the 'Sites' module. If the site ``example.com`` is listed, click it and update the details so they are relevant for your website. - -8. If you do not send mail directly from your web server (eg, you need to use an SMTP server) then edit your ``settings.py`` file so it contains your mail server details:: +7. If you do not send mail directly from your web server (eg, you need to use an SMTP server) then edit your ``settings.py`` file so it contains your mail server details:: EMAIL_HOST = 'XXXXX' EMAIL_HOST_USER = 'YYYYYY@ZZZZ.PPP' EMAIL_HOST_PASSWORD = '123456' -9. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know `_. +8. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know `_. You're now up and running! Happy ticketing.