Skip to content

Commit

Permalink
Emit all types
Browse files Browse the repository at this point in the history
  • Loading branch information
addixon committed Jun 20, 2024
1 parent fd3b64c commit a492e72
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mqttlistener/Forward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public async Task<IActionResult> 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;

Expand All @@ -101,8 +101,9 @@ public async Task<IActionResult> 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);
Expand Down

0 comments on commit a492e72

Please sign in to comment.