category added

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

View File

@@ -2008,17 +2008,24 @@ 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;
} }
var ticketInfo2 = new cM42TicketInfo() Guid? requestCategoryId = ticketInfo.CategoryId;
{ if (requestCategoryId.HasValue && requestCategoryId.Value == Guid.Empty)
Subject = ticketInfo.Summary, {
DescriptionHTML = ticketInfo.DescriptionHtml, requestCategoryId = null;
SolutionHTML = ticketInfo.SolutionHtml, }
User = userID,
var ticketInfo2 = new cM42TicketInfo()
{
Subject = ticketInfo.Summary,
DescriptionHTML = ticketInfo.DescriptionHtml,
SolutionHTML = ticketInfo.SolutionHtml,
User = userID,
Asset = assetId, Asset = assetId,
Service = ticketInfo.AffectedService, Service = ticketInfo.AffectedService,
Template = ticketInfo.Quickcall, Template = ticketInfo.Quickcall,
EntryBy = 20500 Category = requestCategoryId,
}; EntryBy = 20500
};
var quickCallFragments = quickCallFragmentListTask?.Result; var quickCallFragments = quickCallFragmentListTask?.Result;
if (quickCallFragments != null) if (quickCallFragments != null)
@@ -2052,8 +2059,8 @@ 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))
ticketInfo2.NotifyResponsible = notifyResponsible; ticketInfo2.NotifyResponsible = notifyResponsible;
@@ -2203,10 +2210,15 @@ namespace C4IT.DataHistoryProvider
var ticketID = (Guid)ticketInfo.Ticket; var ticketID = (Guid)ticketInfo.Ticket;
var ticket = await GetObjectAsync(activityType, ticketID, false, requestInfo, LogDeep + 1, token); var ticket = await GetObjectAsync(activityType, ticketID, false, requestInfo, LogDeep + 1, token);
if (ticketInfo.Quickcall.HasValue && ticketInfo.Quickcall.Value != Guid.Empty) if (ticketInfo.Quickcall.HasValue && ticketInfo.Quickcall.Value != Guid.Empty)
{ {
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;