From bb804f9a1ed6208d9e75d3bdc940be74612513b0 Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Tue, 3 Feb 2026 14:29:19 +0100 Subject: [PATCH] Auto-commit local changes before build (2026-02-03 14:29:19) --- .last-branch | 2 +- .../src/backend/app/main/routes_run_checks.py | 8 ++++++-- docs/changelog.md | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.last-branch b/.last-branch index dce2111..ae1578e 100644 --- a/.last-branch +++ b/.last-branch @@ -1 +1 @@ -v20260203-07-autotask-notes-endpoint-fix +v20260203-08-autotask-ticketnote-timezone-suffix diff --git a/containers/backupchecks/src/backend/app/main/routes_run_checks.py b/containers/backupchecks/src/backend/app/main/routes_run_checks.py index 0b8a7ea..40c58a7 100644 --- a/containers/backupchecks/src/backend/app/main/routes_run_checks.py +++ b/containers/backupchecks/src/backend/app/main/routes_run_checks.py @@ -1847,14 +1847,18 @@ def api_run_checks_autotask_resolve_note(): if ticket_id <= 0: return jsonify({"status": "error", "message": "Run has an invalid Autotask ticket id."}), 400 - now = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ") + tz_name = _get_ui_timezone_name() + tz = _get_ui_timezone() + now_utc = datetime.utcnow().replace(tzinfo=timezone.utc) + now_local = now_utc.astimezone(tz) if tz else now_utc + now = now_local.strftime("%Y-%m-%d %H:%M:%S") actor = (getattr(current_user, "email", None) or getattr(current_user, "username", None) or "operator") ticket_number = str(getattr(run, "autotask_ticket_number", "") or "").strip() marker = "[Backupchecks] Marked as resolved in Backupchecks" body = ( f"{marker} (ticket remains open in Autotask).\n" - f"Time: {now}\n" + f"Time: {now} ({tz_name})\n" f"By: {actor}\n" + (f"Ticket: {ticket_number}\n" if ticket_number else "") ) diff --git a/docs/changelog.md b/docs/changelog.md index a2a66df..ccd2d5b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -500,6 +500,11 @@ Changes: - Improved backend error handling so Autotask write errors return valid JSON instead of breaking the request. - Made the ticket note payload more robust to support tenant-specific field requirements. +## v20260203-08-autotask-ticketnote-timezone-suffix + +- Updated Autotask ticket note timestamps to use the configured Backupchecks timezone instead of UTC. +- Added a timezone suffix to the timestamp in the ticket note (e.g. Europe/Amsterdam). +- Ensured all user-visible timestamps written to Autotask follow the timezone setting from Backupchecks. *** ## v0.1.21