diff --git a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java b/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java index 6e1fa16d4..8bc110c2a 100644 --- a/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java +++ b/libraries/bot-builder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java @@ -1096,6 +1096,7 @@ public CompletableFuture createConversation( * @return A task that represents the work queued to execute. */ @SuppressWarnings("checkstyle:InnerAssignment") + @Deprecated public CompletableFuture createConversation( String channelId, String serviceUrl, @@ -1112,13 +1113,21 @@ public CompletableFuture createConversation( if (!StringUtils.isEmpty(tenantId)) { // Putting tenantId in channelData is a temporary solution while we wait for the // Teams API to be updated - ObjectNode channelData = JsonNodeFactory.instance.objectNode(); - channelData.set( - "tenant", - JsonNodeFactory.instance.objectNode().set("tenantId", JsonNodeFactory.instance.textNode(tenantId)) - ); + if (conversationParameters.getChannelData() != null) { + ((ObjectNode) conversationParameters.getChannelData()).set( + "tenantId", + JsonNodeFactory.instance.textNode(tenantId) + ); + } else { + ObjectNode channelData = JsonNodeFactory.instance.objectNode(); + channelData.set( + "tenant", + JsonNodeFactory.instance.objectNode() + .set("tenantId", JsonNodeFactory.instance.textNode(tenantId)) + ); - conversationParameters.setChannelData(channelData); + conversationParameters.setChannelData(channelData); + } conversationParameters.setTenantId(tenantId); }