diff --git a/docs/configuration.rst b/docs/configuration.rst index 3491c27a..9cc30d7a 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -36,6 +36,10 @@ 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 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, + )