From abd37ba0148d5b41da3b43d8e4704497b704c7bf Mon Sep 17 00:00:00 2001 From: Pooja Shah Date: Wed, 21 Dec 2016 20:03:26 +0530 Subject: [PATCH] moved message to 'text' instead of 'fields' to resolve truncated message issue for longer text --- .../jenkins/plugins/slack/StandardSlackService.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/jenkins/plugins/slack/StandardSlackService.java b/src/main/java/jenkins/plugins/slack/StandardSlackService.java index c42e16ad..84c77695 100755 --- a/src/main/java/jenkins/plugins/slack/StandardSlackService.java +++ b/src/main/java/jenkins/plugins/slack/StandardSlackService.java @@ -58,17 +58,11 @@ public boolean publish(String message, String color) { boolean result = true; for (String roomId : roomIds) { //prepare attachments first - JSONObject field = new JSONObject(); - field.put("short", false); - field.put("value", message); - - JSONArray fields = new JSONArray(); - fields.put(field); - JSONObject attachment = new JSONObject(); + attachment.put("text", message); attachment.put("fallback", message); attachment.put("color", color); - attachment.put("fields", fields); + JSONArray mrkdwn = new JSONArray(); mrkdwn.put("pretext"); mrkdwn.put("text");