Commit Graph

618 Commits

Author SHA1 Message Date
077e1fb176 Add cross-company ticket search for overarching issues
The "Link existing ticket" dialog now searches across all companies when
a ticket number is entered, enabling linking of overarching issues.

Changes:
- Added query_tickets_by_number() to Autotask client
- Route searches both customer's company and cross-company when ticket number detected
- Results are combined and deduplicated (customer tickets shown first)
- Enables linking multi-company infrastructure issues to any job

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 17:01:43 +01:00
e6847b8ec3 Auto-commit local changes before build (2026-02-05 16:47:19) 2026-02-05 16:47:19 +01:00
cc76068206 Make Autotask resolve messages dynamic based on time entries
The resolve confirmation dialog and ticket notes now correctly indicate
whether the ticket will be closed or remain open based on time entry check.

Changes:
- Frontend: Updated confirmation message to explain conditional closure
- Backend: Check time entries before creating note
- Dynamic message in ticket note:
  * "ticket will be closed in Autotask" (no time entries)
  * "ticket remains open in Autotask due to existing time entries" (has time entries)
- Updated route docstring to reflect conditional status behaviour

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:46:43 +01:00
237ae4f431 Auto-commit local changes before build (2026-02-05 16:35:56) 2026-02-05 16:35:56 +01:00
9b905fa24f Add conditional ticket status update based on time entries
Implements API contract section 9: ticket resolution workflow with
conditional status updates based on time entry existence.

- Added query_time_entries_by_ticket_id() for POST /TimeEntries/query
- update_ticket_resolution_safe() now checks time entries:
  * No time entries: sets status to 5 (Complete)
  * Has time entries: keeps current status (ticket remains open)

This ensures tickets are only auto-closed when appropriate per the
validated Autotask API workflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:35:28 +01:00
88421badbd Auto-commit local changes before build (2026-02-05 16:30:22) 2026-02-05 16:30:22 +01:00
8a733a356b Fix Autotask resolution to preserve exact field values from GET response
The issueType, subIssueType, and source fields must be sent in the PUT
payload with their exact values from GET response, including null. This
fixes HTTP 500 error where Autotask rejected picklist value 0.

Changed _pick function to return (found, value) tuple to distinguish
between "field missing" and "field is null".

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 16:29:54 +01:00
8baf4e8ff1 Auto-commit local changes before build (2026-02-05 14:45:36) 2026-02-05 14:45:36 +01:00
a9a60e3315 Restore Autotask PSA integration
Restored from branch v20260203-13-autotask-resolution-item-wrapper with
the following functionality:

- Autotask REST API client with support for tickets, notes, companies,
  and reference data (queues, sources, priorities, statuses)
- Safe ticket updates preserving stabilizing fields per API contract
- Database models for Autotask settings, customer mapping, and ticket linkage
- Settings UI for Autotask configuration with connection test
- Run Checks integration for ticket creation
- Customers page with Autotask company mapping
- Ticket linking during mail import

Also preserved the require_daily_dashboard_visit setting from the
current branch.

Added docs/autotask_rest_api.md with validated API contract from Postman tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:43:44 +01:00
4b66ec1c6a Auto-commit local changes before build (2026-02-04 22:03:24) 2026-02-04 22:03:24 +01:00
abf8b89d7c Add setting to enable/disable daily dashboard redirect
Added a new setting in Settings > General > Navigation that allows
administrators to control whether users are redirected to the dashboard
on their first page view each day.

Changes:
- Added require_daily_dashboard_visit column to SystemSettings model
- Added migration for the new column (default: FALSE)
- Modified before_request hook to check the setting before redirecting
- Added Navigation card with toggle in Settings General page
- Restored changelog-claude.md with performance and feature updates

Default is OFF - users can navigate directly to any page without
being forced to visit the dashboard first.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:03:11 +01:00
0ddeaf1896 Add migration for performance indexes
The indexes defined in models.py __table_args__ are not automatically
created by the custom migration system. Added migrate_performance_indexes()
to explicitly create the indexes at startup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:54:27 +01:00
89b9dd0264 Auto-commit local changes before build (2026-02-04 21:46:27) 2026-02-04 21:46:27 +01:00
f91c081456 Performance optimizations for slow storage environments
- Add database indexes on frequently queried FK columns (JobRun, MailMessage,
  MailObject, TicketScope, RemarkScope)
- Fix N+1 query in override recomputation by batch loading jobs
- Optimize Daily Jobs page with batch queries:
  - Batch load all today's runs in single query
  - Batch infer weekly/monthly schedules for all jobs
  - Batch load ticket/remark indicators

These changes reduce query count by 80-90% on pages like Daily Jobs and Run Checks,
significantly improving performance on systems with slower storage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:44:14 +01:00
39bdd49fd0 Add README documentation and Claude changelog
- Fill README.md with comprehensive project documentation
- Add docs/changelog-claude.md for tracking Claude Code changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:30:53 +01:00
5ec64e6a13 Auto-commit local changes before build (2026-02-03 17:16:24) 2026-02-03 17:16:24 +01:00
55c6f7ddd6 Auto-commit local changes before build (2026-02-03 16:50:56) 2026-02-03 16:50:56 +01:00
2667e44830 Auto-commit local changes before build (2026-02-03 16:39:32) 2026-02-03 16:39:32 +01:00
04f6041fe6 Auto-commit local changes before build (2026-02-03 16:17:17) 2026-02-03 16:17:17 +01:00
494f792c0d Auto-commit local changes before build (2026-02-03 16:06:14) 2026-02-03 16:06:14 +01:00
bb804f9a1e Auto-commit local changes before build (2026-02-03 14:29:19) 2026-02-03 14:29:19 +01:00
a4a6a60d45 Auto-commit local changes before build (2026-02-03 14:13:08) 2026-02-03 14:13:08 +01:00
ddc6eaa12a Auto-commit local changes before build (2026-02-03 13:59:08) 2026-02-03 13:59:08 +01:00
f6216b8803 Auto-commit local changes before build (2026-02-03 13:12:53) 2026-02-03 13:12:53 +01:00
fb2651392c Auto-commit local changes before build (2026-02-03 12:28:38) 2026-02-03 12:28:38 +01:00
e3303681e1 Auto-commit local changes before build (2026-02-03 11:06:35) 2026-02-03 11:06:35 +01:00
3c7f4c7926 Auto-commit local changes before build (2026-02-03 10:31:44) 2026-02-03 10:31:44 +01:00
3400af58d7 Auto-commit local changes before build (2026-01-20 13:42:54) 2026-01-20 13:42:54 +01:00
67fb063267 Auto-commit local changes before build (2026-01-20 13:32:55) 2026-01-20 13:32:55 +01:00
ae1865dab3 Auto-commit local changes before build (2026-01-20 13:22:37) 2026-01-20 13:22:37 +01:00
92c67805e5 Auto-commit local changes before build (2026-01-20 13:10:45) 2026-01-20 13:10:45 +01:00
fc0cf1ef96 Auto-commit local changes before build (2026-01-20 12:52:16) 2026-01-20 12:52:16 +01:00
899863a0de Auto-commit local changes before build (2026-01-20 10:44:53) 2026-01-20 10:44:53 +01:00
e4e069a6b3 Auto-commit local changes before build (2026-01-20 10:34:23) 2026-01-20 10:34:23 +01:00
dfca88d3bd Auto-commit local changes before build (2026-01-20 10:28:38) 2026-01-20 10:28:38 +01:00
5c0e1b08aa Auto-commit local changes before build (2026-01-20 10:07:44) 2026-01-20 10:07:44 +01:00
4b506986a6 Auto-commit local changes before build (2026-01-20 09:16:35) 2026-01-20 09:16:35 +01:00
5131d24751 Auto-commit local changes before build (2026-01-20 08:49:15) 2026-01-20 08:49:15 +01:00
63526be592 Auto-commit local changes before build (2026-01-19 16:27:38) 2026-01-19 16:27:38 +01:00
b56cdacf6b Auto-commit local changes before build (2026-01-19 15:59:26) 2026-01-19 15:59:26 +01:00
4b3b6162a0 Auto-commit local changes before build (2026-01-19 15:47:15) 2026-01-19 15:47:15 +01:00
a7a61fdd64 Auto-commit local changes before build (2026-01-19 15:40:00) 2026-01-19 15:40:00 +01:00
8407bf45ab Auto-commit local changes before build (2026-01-19 15:30:36) 2026-01-19 15:30:36 +01:00
0cabd2e0fc Auto-commit local changes before build (2026-01-19 15:10:00) 2026-01-19 15:10:00 +01:00
0c5dee307f Auto-commit local changes before build (2026-01-19 14:50:02) 2026-01-19 14:50:02 +01:00
0500491621 Auto-commit local changes before build (2026-01-19 14:23:56) 2026-01-19 14:23:56 +01:00
890553f23e Auto-commit local changes before build (2026-01-19 14:18:29) 2026-01-19 14:18:29 +01:00
c5ff1e11a3 Auto-commit local changes before build (2026-01-19 14:06:42) 2026-01-19 14:06:42 +01:00
c595c165ed Auto-commit local changes before build (2026-01-19 13:50:00) 2026-01-19 13:50:00 +01:00
d272d12d24 Auto-commit local changes before build (2026-01-19 13:31:09) 2026-01-19 13:31:09 +01:00