Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #41 from Tamini/develop
[JENKINS-22628] Switched comment and description strings to use String.f...
  • Loading branch information
artkoshelev committed Apr 15, 2014
2 parents eaa8760 + 83cd21d commit 035a36c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/hudson/plugins/jira/JiraCreateIssueNotifier.java
Expand Up @@ -144,8 +144,8 @@ private RemoteIssue createJiraIssue(AbstractBuild<?, ?> build, String filename)
String jenkinsURL = Jenkins.getInstance().getRootUrl();

String checkDescription = (this.testDescription == "") ? "No description is provided" : this.testDescription;
String description = "The test " + jobName + " has failed." + "\n\n" + checkDescription + "\n\n" + "* First failed run : [" +
buildNumber + "|" + buildURL + "]" + "\n" + "** [console log|" + buildURL.concat("console") + "]";
String description = String.format("The test %s has failed. \n\n%s\n\n* First failed run : [%s|%s]\n** [console log|%s]",
jobName, checkDescription, buildNumber, buildURL, buildURL.concat("console"));

RemoteComponent[] components = getJiraComponents(build, this.component);

Expand Down Expand Up @@ -331,8 +331,8 @@ private void currentBuildResultFailure(AbstractBuild<?, ?> build, BuildListener
String buildURL = environmentVariable.get("BUILD_URL");
String buildNumber = environmentVariable.get("BUILD_NUMBER");
if (previousBuildResult == Result.FAILURE) {
String comment = "- Job is still failing." + "\n" + "- Failed run : [" +
buildNumber + "|" + buildURL + "]" + "\n" + "** [console log|" + buildURL.concat("console") + "]";
String comment = String.format("- Job is still failing.\n- Failed run : [%s|%s]\n** [console log|%s]",
buildNumber, buildURL, buildURL.concat("console"));
//Get the issue-id which was filed when the previous built failed
String issueId = getIssue(filename);
if (issueId != null) {
Expand Down Expand Up @@ -390,8 +390,8 @@ private void currentBuildResultSuccess(AbstractBuild<?, ?> build, BuildListener
String buildNumber = environmentVariable.get("BUILD_NUMBER");

if (previousBuildResult == Result.FAILURE || previousBuildResult == Result.SUCCESS) {
String comment = "- Job is not failing but the issue is still open." + "\n" + "- Passed run : [" +
buildNumber + "|" + buildURL + "]" + "\n" + "** [console log|" + buildURL.concat("console") + "]";
String comment = String.format("- Job is not failing but the issue is still open \n - Passed run : [%s|%s]\n **[console log|%s]",
buildNumber, buildURL, buildURL.concat("console"));
String issueId = getIssue(filename);

//if issue exists it will check the status and comment or delete the file accordingly
Expand Down

0 comments on commit 035a36c

Please sign in to comment.