Add direct Autotask ticket link in Run Checks modal

Added "Open in Autotask" button next to ticket number in Run Checks modal
for quick navigation to the ticket in Autotask PSA.

Changes:
- Enhanced renderAutotaskInfo() function in run_checks.html
- Button appears only when autotask_ticket_id exists
- Opens in new tab with proper Autotask URL format
- Styled as small outline button for compact layout
- URL format: https://ww19.autotask.net/Mvc/ServiceDesk/TicketDetail.mvc?workspace=False&ids[0]={id}&ticketId={id}

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Ivo Oskamp 2026-02-06 13:06:36 +01:00
parent cf35879c36
commit d8ddec1fb1
2 changed files with 16 additions and 1 deletions

View File

@ -925,6 +925,7 @@ table.addEventListener('change', function (e) {
function renderAutotaskInfo(run) {
if (!atInfo) return;
var num = (run && run.autotask_ticket_number) ? String(run.autotask_ticket_number) : '';
var ticketId = (run && run.autotask_ticket_id) ? String(run.autotask_ticket_id) : '';
var isResolved = !!(run && run.autotask_ticket_is_resolved);
var origin = (run && run.autotask_ticket_resolved_origin) ? String(run.autotask_ticket_resolved_origin) : '';
var isDeleted = !!(run && run.autotask_ticket_is_deleted);
@ -947,7 +948,16 @@ table.addEventListener('change', function (e) {
} else if (isResolved && origin === 'psa') {
extra = '<div class="mt-1"><span class="badge bg-secondary">Resolved by PSA</span></div>';
}
atInfo.innerHTML = '<div><strong>Ticket:</strong> ' + escapeHtml(num) + '</div>' + extra;
// Build ticket display with optional direct link
var ticketDisplay = '<div><strong>Ticket:</strong> ' + escapeHtml(num);
if (ticketId) {
var autotaskUrl = 'https://ww19.autotask.net/Mvc/ServiceDesk/TicketDetail.mvc?workspace=False&ids%5B0%5D=' + encodeURIComponent(ticketId) + '&ticketId=' + encodeURIComponent(ticketId);
ticketDisplay += ' <a href="' + escapeHtml(autotaskUrl) + '" target="_blank" rel="noopener noreferrer" class="btn btn-sm btn-outline-primary ms-1" style="padding: 0.125rem 0.5rem; font-size: 0.75rem;">Open in Autotask</a>';
}
ticketDisplay += '</div>';
atInfo.innerHTML = ticketDisplay + extra;
} else if (run && run.autotask_ticket_id) {
atInfo.innerHTML = '<div><strong>Ticket:</strong> created</div>';
} else {

View File

@ -31,6 +31,11 @@ This file documents all changes made to this project via Claude Code.
### Changed
- Renamed "Refresh" button to "Search" in Link existing Autotask ticket modal for better clarity (the button performs a search operation)
- Added ellipsis-field functionality to "Overall remark" and "Remark" fields in Run Checks modal to prevent long text from hiding action buttons (click to expand/collapse)
- Enhanced Autotask ticket display in Run Checks modal:
- Added "Open in Autotask" button next to ticket number for direct navigation to ticket in Autotask PSA
- Button only appears when ticket is linked (autotask_ticket_id exists) and Autotask integration is enabled
- Opens in new tab with proper URL format including workspace and ticket ID parameters
- Styled as small outline button to maintain compact layout
## [2026-02-05]