Welcome to MyTicket.
This guide explains how to bulk-manage employees via CSV, and how to inspect what was imported and export data for reporting.
✅ Everything below is available after login + OTP (two-factor).
🔐 Some actions require specific permissions (details inside).
🧭 What you can do here
Download a strict CSV template for employees.
Validate a CSV before it touches the database (no partial writes).
Commit a valid CSV (safe upsert by employee ID).
Export audit logs (HTML & CSV).
Export employees (CSV) with filters (if permitted).
👤 Who can access what
Import page: /employees/import/
Logs page: /employees/import/logs/
Logs CSV export: /employees/import/logs.csv
Permissions (examples; your admin grants these):
View audit logs: icelicensing.view_employeeimportaudit
Export employees CSV: icelicensing.can_export_employees
Superusers bypass permission checks.
📥 Download the CSV template
URL: /employees/import/template.csv
The template is strict. Column order and headers must match exactly.
🧪 Validate your CSV (no database writes yet)
Go to /employees/import/, choose your file, click Validate.
Validation checks include:
Header exact match (strict).
Encoding: UTF-8 (BOM is OK).
File size ≤ 10 MB.
Per-row required fields & formats (email, boolean, country code).
Duplicate employee_id/email within the file (per tenant).
Collisions in the database:
Upserts allowed by employee_id.
New rows require email to be free in that tenant.
Email change permitted only for the same employee_id.
If there are issues:
You’ll see a red panel with the first errors.
Download the full error CSV via the button.
Fix your file and re-validate.
If everything looks good:
You’ll see a green status: “All rows valid. Ready to commit.”
🔁 If the same file (same SHA-256) was already successfully committed for the same tenants, you’ll see an inline warning. Commit will be blocked (idempotency guard).
✅ Commit the import (safe upsert)
On the same /employees/import/ page (after Validate), click Commit import.
What happens:
A per-tenant lock is acquired (prevents concurrent imports).
The batch is applied atomically (transaction): all or nothing.
Rows are inserted or updated by employee_id (per tenant).
If nothing changed for a row, it’s counted as unchanged.
On success you’ll see a summary:
Inserted: X
Updated: Y
Unchanged: Z
⏱️ Temporary upload files auto-expire (default: 24h).
🔒 Tenant locks auto-expire (default: 15 min).
📤 Export employees (CSV)
If you have the permission icelicensing.can_export_employees, you’ll see an Export button (or link) on relevant pages. Exports can respect filters (tenant, status, date, etc.), depending on your UI.
If you don’t see the button, ask your admin to grant the permission.
🧾 Audit logs (HTML & CSV)
HTML: /employees/import/logs/
CSV: /employees/import/logs.csv
What you’ll see:
Timestamp, user, tenants, file name/size, file hash (short), template version.
Total rows, inserted, updated, (and unchanged in the message).
Status: success / failed.
You can filter logs via query params (examples):
By tenant code: ?tenant=ACME
By status: ?status=success
By date range (inclusive): ?from=2025-08-01&to=2025-08-31
By user: ?user=alice
Limit rows: ?limit=200
🧹 Housekeeping & retention
Temporary uploads: auto-purged after expiry.
Audit logs: your admin may periodically purge older entries (e.g., >180 days) according to policy.
🔍 Troubleshooting
“Header mismatch” → re-download the template and copy your data into it.
“Invalid country code” → use ISO-2 (e.g. ME, GB), not names.
“Duplicate employee_id/email in file” → fix duplicates within the same tenant.
“Email already used in this tenant” → another employee uses that email; either update that employee by employee_id, or change the email.
“Another import is running” → wait for tenant locks to expire (or finish), then retry.
“This exact file was already committed” → the idempotency guard is working; modify the file (or use a new one) before committing.