Subject:'$[/javascript myJob.outcome.toUpperCase()]' Job '$[jobName]' - Commander notification $[/javascript var html = new String(""); ; var jobStatus; if ( myJob.outcome == "error"){ jobStatus = "FAILURE"; } else if ( myJob.outcome == "warning"){ jobStatus = "WARNING"; } else if ( myJob.outcome == "success"){ jobStatus = "SUCCESS"; } html += "

" + jobStatus + "

"; var jobLink = "https://cmdr.com/commander/jobDetails.php?jobId=" + myJob.jobId; var jobName = myJob.jobName; html += "Job: " + jobName + ""; var changelist = myJob.Changelist; var changelistUser = myJob.ChangeUser; var changelistUserEmail = myJob.ChangeUserEmail; var changelistLink = "http://perf.com:443/" + changelist + "?ac=10" html += "

" + jobStatus + " on changelist " + changelist + " checked in by " + changelistUser + "

"; ]

Job Info

Started Completed Build Time Outcome Error Code Error Message About Status
$[start] $[finish] $[/javascript var html = ""; var elapsedMilliseconds = myJob.elapsedTime; var elapsedSeconds = Math.floor(elapsedMilliseconds / 1000); var elapsedMinutes = Math.floor(elapsedSeconds / 60); var elapsedHours = Math.floor(elapsedMinutes / 60); elapsedMinutes -= 60 * elapsedHours; elapsedSeconds -= 60 * elapsedMinutes; var elapsedTime = ((elapsedHours == 0) ? "" : elapsedHours + " h ") + ((elapsedMinutes == 0) ? "" : elapsedMinutes + " m ") + ((elapsedSeconds == 0) ? "0 s" : elapsedSeconds + " s "); html += elapsedTime; ] $[outcome] $[errorCode] $[errorMessage] $[abortStatus]

Job Steps

$[/javascript var html = ""; for (var stepName in myJob.steps) { var thisStep = myJob.steps[stepName]; createTable(thisStep, 0); } function createTable(jobStep, indentLevel) { var jobStepName = jobStep.name; var jobStepLink = "https://cmdr.com/commander/link/jobStepDetails/jobSteps/" + jobStep.jobStepId + "?jobId=" + jobStep.jobId; var jobStepLogName = jobStep.logFileName == null ? "" : jobStep.logFileName.replace(/ /g, "+"); var jobStepLogLink = jobStep.logFileName == null ? "" :"https://cmdr.com/commander/link/workspaceFile/jobSteps/" + jobStep.jobStepId + "?fileName=" + jobStepLogName; if ((jobStep.summary == null) && ((jobStep.outcome == "success") || (jobStep.outcome == "warning")) && (jobStep.status != "completed") ){ var jobStepSummary = jobStep.status; } else if ((jobStep.summary == null) && ((jobStep.outcome == "success") || (jobStep.outcome == "warning")) && (jobStep.status == "completed") ){ var jobStepSummary = jobStep.status + " with " +jobStep.outcome; } else if ((jobStep.summary == null) && (jobStep.outcome == "error") ){ var jobStepSummary = jobStep.status + " with " +jobStep.outcome ; } else if(jobStep.outcome == "skipped"){ var jobStepSummary = " "; } else if((jobStep.summary != null) && (jobStep.summary != "undefined")){ var jobStepSummary = jobStep.summary; } var outcome = jobStep.outcome; var elapsedSeconds = jobStep.elapsedTime / 1000; var elapsedMinutes = Math.floor(elapsedSeconds / 60); var elapsedHours = Math.floor(elapsedMinutes / 60); elapsedMinutes -= 60 * elapsedHours; elapsedSeconds -= 60 * elapsedMinutes; var elapsedTime = ((elapsedHours == 0) ? "" : elapsedHours + " h ") + ((elapsedMinutes == 0) ? "" : elapsedMinutes + " m ") + ((elapsedSeconds == 0) ? "0 s" : elapsedSeconds + " s "); var exitCode = jobStep.exitCode; var errorCode = jobStep.errorCode == null ? "" : jobStep.errorCode; var errorMessage = jobStep.errorMessage == null ? "" : jobStep.errorMessage; if (jobStep.exitCode == "CANCELED"){ var jobStepSummary = "CANCELED"; } var cssClass = outcome; var whitespace = ""; for (var i = 0; i < indentLevel; i++) { whitespace += " "; if (i < Math.floor(indentLevel / 2)) { cssClass += "-sub"; } } html += " \n"; html += " \n"; if((outcome == "skipped") || (jobStep.logFileName == null)) { html += " \n"; } else{ html += " \n"; } html += " \n"; html += " \n"; html += " \n"; html += " \n"; html += " \n"; html += " \n"; html += " \n"; if ( jobStep.steps ) { for (var subStepName in jobStep.steps) { var thisSubStep = jobStep.steps[subStepName] createTable(thisSubStep, indentLevel + 2); } } } html; ]
Job Step Log (may exist) Outcome StepSummary Elapsed Time Exit Code Error Code Error Message
" + whitespace + "" + jobStepName + " Log" + outcome + "" + jobStepSummary + "" + elapsedTime + "" + exitCode + "" + errorCode + "" + errorMessage + "