{{ ticket.ticket_number }}{{ ticket.creator.full_name }}
{% if ticket.filed_by_staff %}
Filed by {{ ticket.filed_by_staff.full_name }}
{% endif %}
{{ ticket.category.replace('_',' ').title() }}{{ ticket.created_at.strftime('%b %d, %Y %H:%M') }}
{% if ticket.location %}{{ ticket.location }}{% endif %}
{% if ticket.asset_tag %}{{ ticket.asset_tag }}{% endif %}
{% if ticket.ai_generated %}AI-generated{% endif %}
Description
{{ ticket.description }}
{% set ticket_atts = ticket.attachments.filter_by(comment_id=None).all() %}
{% if ticket_atts %}
Attachments
{% for att in ticket_atts %}
{% set ext = att.filename.rsplit('.', 1)[-1].lower() if '.' in att.filename else '' %}
{% set is_img = (att.mime_type and att.mime_type.startswith('image/')) or ext in ('png','jpg','jpeg','gif','webp','svg') %}
{% if is_img %}
{% else %}
{{ att.filename }}
({{ (att.file_size/1024)|int }}KB)
{% endif %}
{% endfor %}
{{ comment.author.full_name }}
{% if comment.author.is_it_staff %}
IT STAFF
{% endif %}
{% if comment.is_internal %}
INTERNAL NOTE
{% endif %}
{{ comment.created_at.strftime('%b %d, %Y %H:%M') }}
{% if current_user.is_it_staff or comment.author_id == current_user.id %}
{% endif %}
{{ comment.body | safe }}
{% set c_atts = comment.attachments.all() %}
{% if c_atts %}
{% for att in c_atts %}
{% set ext = att.filename.rsplit('.', 1)[-1].lower() if '.' in att.filename else '' %}
{% set is_img = (att.mime_type and att.mime_type.startswith('image/')) or ext in ('png','jpg','jpeg','gif','webp','svg') %}
{% if is_img %}
{% else %}
{{ att.filename }}
{% endif %}
{% endfor %}
{% endif %}
{% else %}
No comments yet. Be the first to add an update.
{% endfor %}
{% if ticket.status not in ('closed',) %}
Add Comment
{% endif %}
{% if current_user.is_it_staff %}
Update Ticket
{% endif %}
{% if current_user.is_it_staff %}
Linked Tickets
{% if linked_tickets %}
{% for lnk, other in linked_tickets %}
{# ── Field label ── #}
{% if h.field_name == 'assigned_to' %}
Assigned To
{% elif h.field_name == 'status' %}
Status
{% elif h.field_name == 'priority' %}
Priority
{% else %}
{{ h.field_name.replace('_',' ').title() }}
{% endif %}
{# ── Values — format status/priority nicely; keep others as-is ── #}
{% set old = h.old_value or 'Unassigned' %}
{% set new = h.new_value or 'Unassigned' %}
{% if h.field_name in ('status', 'priority') %}
{% set old = old.replace('_',' ').title() %}
{% set new = new.replace('_',' ').title() %}
{% endif %}
changed from {{ old }} to {{ new }} by {{ h.changer.full_name }} · {{ h.changed_at.strftime('%b %d %H:%M') }}
{% endfor %}
{% endif %}
{% if ticket.status in ('resolved', 'closed') and
(current_user.is_it_staff or ticket.created_by_id == current_user.id) %}
Has this issue returned?
Re-open this ticket to notify IT staff and resume tracking.