This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new 7437ec80 IGNITE-27101 Fixed json structure of comment api v3 (#204)
7437ec80 is described below

commit 7437ec80e9b227b0cd6cdb304f0ff1f6456668d4
Author: Slava Koptilin <[email protected]>
AuthorDate: Fri Nov 21 10:54:59 2025 +0200

    IGNITE-27101 Fixed json structure of comment api v3 (#204)
---
 .../ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java       |  2 +-
 .../ci/tcbot/jira/v3/JiraCommentsGeneratorV3.java       |  3 ++-
 .../ignite/ci/tcbot/jira/v3/adf/ElementContainer.java   | 17 +++++++++++++++++
 .../main/java/org/apache/ignite/jiraservice/Jira.java   |  2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java
index 97725872..3683059e 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v2/JiraCommentsGeneratorV2.java
@@ -197,6 +197,6 @@ public class JiraCommentsGeneratorV2 {
 
         res.append("\\n").append(newTests).append("\\n").append("[TeamCity 
*").append(suiteNameForComment).append("* Results|").append(webUrl).append(']');
 
-        return xmlEscapeText(res.toString());
+        return "\"" + xmlEscapeText(res.toString()) + "\"";
     }
 }
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/JiraCommentsGeneratorV3.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/JiraCommentsGeneratorV3.java
index 119494f2..edae209a 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/JiraCommentsGeneratorV3.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/JiraCommentsGeneratorV3.java
@@ -40,6 +40,7 @@ import static 
org.apache.ignite.ci.tcbot.jira.JiraCommentsGenerator.FAILED_TEST_
 import static 
org.apache.ignite.ci.tcbot.jira.JiraCommentsGenerator.NEW_TEST_SUITE_COLOR;
 import static 
org.apache.ignite.ci.tcbot.jira.JiraCommentsGenerator.PASSED_TEST_COLOR;
 import static 
org.apache.ignite.ci.tcbot.jira.JiraCommentsGenerator.jiraEscText;
+import static org.apache.ignite.tcservice.util.XmlUtil.xmlEscapeText;
 
 public class JiraCommentsGeneratorV3 {
     /**
@@ -181,6 +182,6 @@ public class JiraCommentsGeneratorV3 {
         root.append(newTestsPanel);
         root.append(linkToBuild);
 
-        return new GsonBuilder().create().toJson(root);
+        return xmlEscapeText(new GsonBuilder().create().toJson(root));
     }
 }
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/adf/ElementContainer.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/adf/ElementContainer.java
index 9d0bbc21..c915325d 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/adf/ElementContainer.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/jira/v3/adf/ElementContainer.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.ci.tcbot.jira.v3.adf;
 
 import java.util.ArrayList;
diff --git a/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java 
b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java
index 05820341..db903398 100644
--- a/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java
+++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java
@@ -106,7 +106,7 @@ class Jira implements IJiraIntegration {
 
         String url = jiraApiUrl + "issue/" + ticket + "/comment";
 
-        return 
HttpUtil.sendPostAsStringToJira(config().decodedHttpAuthToken(), url, 
"{\"body\": \"" + comment + "\"}");
+        return 
HttpUtil.sendPostAsStringToJira(config().decodedHttpAuthToken(), url, 
"{\"body\": " + comment + "}");
     }
 
     /**

Reply via email to