category added

This commit is contained in:
Meik
2025-11-14 15:07:42 +01:00
parent b1244c93f3
commit 552e35cefc

View File

@@ -2008,6 +2008,12 @@ namespace C4IT.DataHistoryProvider
LogEntry($"No initiating user found with state active (710) and AD Common Name: {ticketInfo.User}", LogLevels.Error); LogEntry($"No initiating user found with state active (710) and AD Common Name: {ticketInfo.User}", LogLevels.Error);
return null; return null;
} }
Guid? requestCategoryId = ticketInfo.CategoryId;
if (requestCategoryId.HasValue && requestCategoryId.Value == Guid.Empty)
{
requestCategoryId = null;
}
var ticketInfo2 = new cM42TicketInfo() var ticketInfo2 = new cM42TicketInfo()
{ {
Subject = ticketInfo.Summary, Subject = ticketInfo.Summary,
@@ -2017,6 +2023,7 @@ namespace C4IT.DataHistoryProvider
Asset = assetId, Asset = assetId,
Service = ticketInfo.AffectedService, Service = ticketInfo.AffectedService,
Template = ticketInfo.Quickcall, Template = ticketInfo.Quickcall,
Category = requestCategoryId,
EntryBy = 20500 EntryBy = 20500
}; };
@@ -2052,7 +2059,7 @@ namespace C4IT.DataHistoryProvider
if (Guid.TryParse((string)quickCallData?.Service, out Guid service)) if (Guid.TryParse((string)quickCallData?.Service, out Guid service))
ticketInfo2.Service = ticketInfo2.Service ?? service; ticketInfo2.Service = ticketInfo2.Service ?? service;
if (Guid.TryParse((string)quickCallData?.Category, out Guid category)) if (!ticketInfo2.Category.HasValue && Guid.TryParse((string)quickCallData?.Category, out Guid category))
ticketInfo2.Category = category; ticketInfo2.Category = category;
if (bool.TryParse((string)quickCallData?.NotifyResponsible, out bool notifyResponsible)) if (bool.TryParse((string)quickCallData?.NotifyResponsible, out bool notifyResponsible))
@@ -2207,6 +2214,11 @@ namespace C4IT.DataHistoryProvider
{ {
ticket["SPSActivityClassIncident"]["Quickcall"] = ticketInfo.Quickcall.Value; ticket["SPSActivityClassIncident"]["Quickcall"] = ticketInfo.Quickcall.Value;
} }
if (ticketInfo.CategoryId.HasValue && ticketInfo.CategoryId.Value != Guid.Empty)
{
ticket["SPSActivityClassIncident"]["Category"] = ticketInfo.CategoryId.Value;
}
if (ticketInfo.AffectedService.HasValue && ticketInfo.AffectedService.Value == Guid.Empty) if (ticketInfo.AffectedService.HasValue && ticketInfo.AffectedService.Value == Guid.Empty)
{ {
ticket["SPSActivityClassBase"]["Service"] = null; ticket["SPSActivityClassBase"]["Service"] = null;