From a492e726c131cf01e5531b7696991452f9bd62cf Mon Sep 17 00:00:00 2001 From: Adam Dixon Date: Thu, 20 Jun 2024 09:12:48 -0500 Subject: [PATCH] Emit all types --- mqttlistener/Forward.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mqttlistener/Forward.cs b/mqttlistener/Forward.cs index 9d618c3..256291b 100644 --- a/mqttlistener/Forward.cs +++ b/mqttlistener/Forward.cs @@ -78,11 +78,11 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Function, " return new BadRequestResult(); } - if (payload.Resource?.Revision?.Fields?.SystemWorkItemType != "Bug") - { - logger.LogInformation("Ignoring work item type: {WorkItemType}", payload.Resource?.Revision?.Fields?.SystemWorkItemType); - return new OkResult(); - } + //if (payload.Resource?.Revision?.Fields?.SystemWorkItemType != "Bug") + //{ + // logger.LogInformation("Ignoring work item type: {WorkItemType}", payload.Resource?.Revision?.Fields?.SystemWorkItemType); + // return new OkResult(); + //} string? assignee = payload.Resource?.Fields?.SystemAssignedTo?.NewValue; @@ -101,8 +101,9 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Function, " var mqttMessage = new { WorkItemId = payload.Resource!.WorkItemId, - Url = payload.Resource.Revision.Url, - Severity = payload.Resource.Revision.Fields.MicrosoftCommonSeverity, + Type = payload.Resource.Revision?.Fields?.SystemWorkItemType, + Url = payload.Resource.Revision?.Url, + Severity = payload.Resource.Revision?.Fields?.MicrosoftCommonSeverity, }; logger.LogInformation("Forwarding message to MQTT broker: {Topic} for WorkItemId: {WorkItemId}", topic, mqttMessage.WorkItemId);