v1.5.0
Co nowego: - Podgląd logów w panelu admina (Admin > Logi) — pliki storage/logs/*.log bez potrzeby dostępu do kontenera, z filtrami poziomu/tekstu/liczby wpisów i auto-odświeżaniem. - Filtr „Bez kategorii” w kolejce operatora — izoluje zgłoszenia bez przypisanej kategorii/podkategorii. - Narzędzie importu z Heska: już nie tworzy automatycznie kont klientów dla nieznanych e-maili (pomija takie zgłoszenia zamiast zakładać konto), łączy odpowiedzi/właścicieli zgłoszeń z realnymi kontami operatorów po e-mailu, nowe flagi --assign-operators i --fix-closed-dates do donaprawiania wcześniejszych importów, dedykowany log storage/logs/hesk-import.log. - Poprawka: pulpit statystyk operatora (rozkład wg kategorii/podkategorii i filtr kategorii) pomijał zgłoszenia przypisane do samej kategorii bez podkategorii (np. z poczty IMAP) — teraz liczone poprawnie. - Poprawka: błąd JS i zawieszone w tle liczniki przy nawigacji z widoku z aktywnym licznikiem (najbardziej odczuwalne w liczniku czasu pracy operatora). - Porządki w bazie: usunięte niewykorzystywane kolumny (users.remember_token, users.email_verified_at, email_templates.trigger_label); wartości pól dodatkowych, stan triage/podsumowania AI i powiązany sprzęt Snipe-IT przeniesione z tabeli tickets do osobnych tabel (ticket_field_values, ticket_ai_summaries, ticket_snipeit_assets) — bez zmiany zachowania, ale pola dodatkowe są teraz efektywnie przeszukiwalne; dodane brakujące indeksy na 4 tabelach pivot; tickets.source/ticket_messages.source walidowane względem znanego zestawu wartości. Zaktualizowana dokumentacja: README, CLAUDE.md, ARCHITECTURE.md, CHANGELOG.md, wiki/admin, wiki/operator. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,13 +20,24 @@ old Hesk install; it doesn't pick up edits made in Hesk afterward.
|
||||
- Auto-assigns a team when every subcategory under the matched category
|
||||
routes to the same single team (same rule `TicketService::autoAssignTeam()`
|
||||
uses for normal ticket creation); ambiguous categories are left unrouted.
|
||||
- Finds or creates a client account per requester e-mail, reusing an existing
|
||||
account (adding the `client` role if it doesn't have it yet) rather than
|
||||
duplicating.
|
||||
- Hesk staff replies are **not** linked to a real operator account (this
|
||||
script never creates operator accounts) — the reply still shows the
|
||||
correct staff name and "operator" badge via `author_name`, just without a
|
||||
clickable user behind it.
|
||||
- Finds the local client account per requester e-mail (matched by e-mail,
|
||||
adding the `client` role if it doesn't have it yet). **Never creates a
|
||||
User** — the servicedesk user base is treated as authoritative/complete, so
|
||||
a Hesk requester e-mail with no matching account means that ticket is
|
||||
skipped (reported at the end, with the list of skipped e-mails).
|
||||
- Hesk staff replies/notes are linked to a real operator account when the
|
||||
Hesk staff member's e-mail matches an existing servicedesk operator/admin
|
||||
account; otherwise they fall back to showing the correct staff name and
|
||||
"operator" badge via `author_name` only, without a clickable user behind
|
||||
it (this script never creates operator accounts either).
|
||||
- Every imported ticket also stores its source Hesk ticket id
|
||||
(`tickets.hesk_ticket_id`, unique). This is a second, DB-level guard
|
||||
against duplicate imports on top of the state file below — if the state
|
||||
file is ever lost or out of sync, a re-run still can't create a duplicate
|
||||
ticket for the same Hesk id.
|
||||
- A ticket's Hesk owner is matched the same way as reply/note authors and
|
||||
set as `assignee_id`, so imported tickets show up correctly assigned in
|
||||
the operator queue instead of everything landing in "Nieprzypisane".
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -73,6 +84,39 @@ tickets without importing anything new:
|
||||
scripts/hesk-import/hesk-import.sh --assign-teams --commit
|
||||
```
|
||||
|
||||
### Fixing closed-ticket dates
|
||||
|
||||
New imports already use Hesk's dedicated `closedat` column (not `lastchange`,
|
||||
which moves forward on any later edit — e.g. a note added after closing) for
|
||||
a closed ticket's date, and record a matching "Status zmieniony na: Zamknięte"
|
||||
history entry. To apply the same correction to tickets imported before this
|
||||
existed (including the original import, from before `hesk_ticket_id` was
|
||||
even tracked — matched back to Hesk via the unique `(email, created_at)` pair
|
||||
instead):
|
||||
|
||||
```bash
|
||||
scripts/hesk-import/hesk-import.sh --fix-closed-dates --commit
|
||||
```
|
||||
|
||||
Doesn't import anything new; safe to re-run (already-correct tickets are left
|
||||
alone).
|
||||
|
||||
### Backfilling ticket ownership
|
||||
|
||||
New imports already set `assignee_id` from Hesk's ticket owner. To apply the
|
||||
same to tickets imported before this existed:
|
||||
|
||||
```bash
|
||||
scripts/hesk-import/hesk-import.sh --assign-operators --commit
|
||||
```
|
||||
|
||||
Only touches tickets with no `assignee_id` yet (never overwrites a manual
|
||||
reassignment made since import) and never invents an assignment — a Hesk
|
||||
owner of 0 or one with no matching servicedesk account is left unassigned,
|
||||
unless it's one of the two ids in `ImportHeskTickets::DELETED_STAFF_REASSIGNMENT`
|
||||
(Hesk staff accounts deleted since, with historical tickets explicitly
|
||||
reassigned to a current operator per the app owner).
|
||||
|
||||
## How it's wired up
|
||||
|
||||
`hesk-import.sh` is a thin wrapper: it loads `.env` in this folder, then runs
|
||||
|
||||
Reference in New Issue
Block a user