From: Stas Vilchik Date: Thu, 4 Feb 2016 15:35:05 +0000 (+0100) Subject: SONAR-7268 Link of "New Issues" notification should bring to the project Issues page X-Git-Tag: 5.4-M13~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=348aa30e464cde630d5664a55366ee7dd784d147;p=sonarqube.git SONAR-7268 Link of "New Issues" notification should bring to the project Issues page --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java index 3317dd9a8a6..e6e7e3eb9ff 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java @@ -171,12 +171,12 @@ public abstract class AbstractNewIssuesEmailTemplate extends EmailTemplate { } protected void appendFooter(StringBuilder message, Notification notification) { - String projectUuid = notification.getFieldValue(FIELD_PROJECT_UUID); + String projectKey = notification.getFieldValue(FIELD_PROJECT_KEY); String dateString = notification.getFieldValue(FIELD_PROJECT_DATE); - if (projectUuid != null && dateString != null) { + if (projectKey != null && dateString != null) { Date date = DateUtils.parseDateTime(dateString); - String url = String.format("%s/issues/search#projectUuids=%s|createdAt=%s", - settings.getServerBaseURL(), encode(projectUuid), encode(DateUtils.formatDateTime(date))); + String url = String.format("%s/component_issues?id=%s#createdAt=%s", + settings.getServerBaseURL(), encode(projectKey), encode(DateUtils.formatDateTime(date))); message .append("See it in SonarQube: ") .append(url) diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_all_details.txt b/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_all_details.txt index 64d4aeb2f3f..38a8cd6bf68 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_all_details.txt +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_all_details.txt @@ -21,4 +21,4 @@ Project: Struts /path/to/file: 3 /path/to/directory: 7 -See it in SonarQube: http://nemo.sonarsource.org/issues/search#projectUuids=ABCDE|createdAt=2010-05-1 \ No newline at end of file +See it in SonarQube: http://nemo.sonarsource.org/component_issues?id=org.apache%3Astruts#createdAt=2010-05-1 \ No newline at end of file diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_partial_details.txt b/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_partial_details.txt index 95b996cc60d..627de81c7b2 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_partial_details.txt +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest/email_with_partial_details.txt @@ -5,4 +5,4 @@ Project: Struts Severity Blocker: 0 Critical: 5 Major: 10 Minor: 3 Info: 1 -See it in SonarQube: http://nemo.sonarsource.org/issues/search#projectUuids=ABCDE|createdAt=2010-05-1 \ No newline at end of file +See it in SonarQube: http://nemo.sonarsource.org/component_issues?id=org.apache%3Astruts#createdAt=2010-05-1 \ No newline at end of file