Browse Source

SONAR-5952 Update the issue permalink in the notification email

tags/latest-silver-master-#65
Julien HENRY 9 years ago
parent
commit
15d8c1da12

+ 2
- 4
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/IssueChangesEmailTemplate.java View File

@@ -81,7 +81,7 @@ public class IssueChangesEmailTemplate extends EmailTemplate {
appendField(sb, "Status", notif.getFieldValue("old.status"), notif.getFieldValue("new.status"));
appendField(sb, "Message", notif.getFieldValue("old.message"), notif.getFieldValue("new.message"));
appendField(sb, "Author", notif.getFieldValue("old.author"), notif.getFieldValue("new.author"));
appendFieldWithoutHistory(sb, "Action Plan", notif.getFieldValue("old.actionPlan"), notif.getFieldValue("new.actionPlan")) ;
appendFieldWithoutHistory(sb, "Action Plan", notif.getFieldValue("old.actionPlan"), notif.getFieldValue("new.actionPlan"));
}

private void appendHeader(Notification notif, StringBuilder sb) {
@@ -92,9 +92,7 @@ public class IssueChangesEmailTemplate extends EmailTemplate {

private void appendFooter(StringBuilder sb, Notification notification) {
String issueKey = notification.getFieldValue("key");
String componentKey = notification.getFieldValue("componentKey");
sb.append("See it in SonarQube: ").append(settings.getServerBaseURL()).append("/component/index#component=").append(componentKey)
.append("&currentIssue=").append(issueKey).append(NEW_LINE);
sb.append("See it in SonarQube: ").append(settings.getServerBaseURL()).append("/issues/search#issues=").append(issueKey).append(NEW_LINE);
}

private void appendLine(StringBuilder sb, @Nullable String line) {

+ 1
- 1
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/notification/IssueChangesEmailTemplateTest/display_component_key_if_no_component_name.txt View File

@@ -3,4 +3,4 @@ Rule: Avoid Cycles
Message: Has 3 cycles


See it in SonarQube: http://nemo.sonarsource.org/component/index#component=org.apache.struts.Action&currentIssue=ABCDE
See it in SonarQube: http://nemo.sonarsource.org/issues/search#issues=ABCDE

+ 1
- 1
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/notification/IssueChangesEmailTemplateTest/email_with_action_plan_change.txt View File

@@ -4,4 +4,4 @@ Message: Has 3 cycles

Action Plan changed to ABC 1.0

See it in SonarQube: http://nemo.sonarsource.org/component/index#component=org.apache.struts.Action&currentIssue=ABCDE
See it in SonarQube: http://nemo.sonarsource.org/issues/search#issues=ABCDE

+ 1
- 1
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/notification/IssueChangesEmailTemplateTest/email_with_assignee_change.txt View File

@@ -4,4 +4,4 @@ Message: Has 3 cycles

Assignee changed to louis

See it in SonarQube: http://nemo.sonarsource.org/component/index#component=org.apache.struts.Action&currentIssue=ABCDE
See it in SonarQube: http://nemo.sonarsource.org/issues/search#issues=ABCDE

+ 1
- 1
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/issue/notification/IssueChangesEmailTemplateTest/email_with_multiple_changes.txt View File

@@ -7,4 +7,4 @@ Assignee changed to louis
Resolution: FALSE-POSITIVE
Status: RESOLVED

See it in SonarQube: http://nemo.sonarsource.org/component/index#component=org.apache.struts.Action&currentIssue=ABCDE
See it in SonarQube: http://nemo.sonarsource.org/issues/search#issues=ABCDE

Loading…
Cancel
Save