Add simplified ticket completion flow

This commit is contained in:
Drechsler, Meik
2026-07-20 10:48:40 +02:00
parent 1a3bef9eeb
commit fb45f1c42b
5 changed files with 203 additions and 5 deletions

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using C4IT.FASD.Base;
using C4IT.FASD.Cockpit.Communication;
using C4IT.Logging;
using FasdDesktopUi.Basics;
@@ -15,6 +17,33 @@ namespace FasdDesktopUi.Basics.Helper
{
private const string DefaultTicketActivityType = "SPSActivityTypeTicket";
internal static async Task<bool> TryOpenFinalizedTicketExternallyAsync(Guid ticketId, enumTicketExternalOpenMode mode)
{
try
{
if (ticketId == Guid.Empty || mode == enumTicketExternalOpenMode.None)
return false;
var linkResult = await cFasdCockpitCommunicationBase.Instance.GetTicketExternalLinkAsync(ticketId, mode);
if (linkResult?.Success != true ||
!Uri.TryCreate(linkResult.Url, UriKind.Absolute, out var ticketUri) ||
(ticketUri.Scheme != Uri.UriSchemeHttp && ticketUri.Scheme != Uri.UriSchemeHttps))
{
LogEntry($"Could not resolve an external link for ticket '{ticketId:D}'.", LogLevels.Warning);
return false;
}
new cBrowsers().Start("default", ticketUri.AbsoluteUri);
return true;
}
catch (Exception ex)
{
LogException(ex);
}
return false;
}
internal static bool TryOpenTicketRelationExternally(cF4sdApiSearchResultRelation relation, bool forceExternal = false)
{
try