From 1962e433c52ac14697fcb9d08c23edb39a8e0f48 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Thu, 24 Oct 2024 14:24:29 +0200 Subject: [PATCH] Set not-mapped-assignee only when the assignee is actually present but not mapped --- .../service/jira/handler/JiraIssueAbstractEventHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/hibernate/infra/replicate/jira/service/jira/handler/JiraIssueAbstractEventHandler.java b/src/main/java/org/hibernate/infra/replicate/jira/service/jira/handler/JiraIssueAbstractEventHandler.java index 2060ded..9e2c4d3 100644 --- a/src/main/java/org/hibernate/infra/replicate/jira/service/jira/handler/JiraIssueAbstractEventHandler.java +++ b/src/main/java/org/hibernate/infra/replicate/jira/service/jira/handler/JiraIssueAbstractEventHandler.java @@ -118,8 +118,10 @@ protected JiraIssue issueToCreate(JiraIssue sourceIssue) { destinationIssue.fields.reporter = user(sourceIssue.fields.reporter).map(this::toUser).orElse(null); } - destinationIssue.fields.assignee = user(sourceIssue.fields.assignee).map(this::toUser) - .orElseGet(context::notMappedAssignee); + if (sourceIssue.fields.assignee != null) { + destinationIssue.fields.assignee = user(sourceIssue.fields.assignee).map(this::toUser) + .orElseGet(context::notMappedAssignee); + } return destinationIssue; }