Wonjun Hong Wonjun Hong 2018-08-10
webhook: Fix webhook bug #371
@ccac98cf5c6ed3b62fab11335d705f6538c25dce
app/models/NotificationEvent.java
--- app/models/NotificationEvent.java
+++ app/models/NotificationEvent.java
@@ -957,6 +957,7 @@
     }
 
     public static NotificationEvent afterMilestoneChanged(Long oldMilestoneId, Issue issue) {
+        issue.milestone.refresh();
         webhookRequest(ISSUE_MILESTONE_CHANGED, issue, false);
 
         NotificationEvent notiEvent = createFromCurrentUser(issue);
app/models/Webhook.java
--- app/models/Webhook.java
+++ app/models/Webhook.java
@@ -329,7 +329,7 @@
     }
 
     private String buildJsonWithIssueEventDetails(Issue eventIssue, ArrayNode detailFields, ArrayNode attachments, String requestMessage) {
-        detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "notification.type.milestone.changed"), eventIssue.milestoneId().toString(), true));
+        detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "notification.type.milestone.changed"), eventIssue.milestone.title, true));
         detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), ""), eventIssue.assigneeName(), true));
         detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "issue.state"), eventIssue.state.toString(), true));
         attachments.add(buildAttachmentJSON(eventIssue.body, detailFields));
Add a comment
List