Commits

John Masson  committed e425167

- Updated URL for new bamboo lotion
- Fixed some habib typo's
- Included the status of the issues to help with picking out what was actually finished

  • Participants
  • Parent commits 92b14d9

Comments (0)

Files changed (1)

File bamboo-jira-releasenotes.php

 <?php
-	DEFINE("BAMBOO", "https://bamboo.extranet.atlassian.com/rest/api/latest/"); //Must have /rest/api/latest at the end
+	DEFINE("BAMBOO", "https://confluence-bamboo.atlassian.com/rest/api/latest/"); //Must have /rest/api/latest at the end
 
 	//Check and set script input
 	if(defined('STDIN')){
 			if (isset($argv[6])){
 				DEFINE("END_BUILD", $argv[6]);
 			}
-			echo "\n [INFO] Starting release notes for ".BAMBOO_PROJECTKEY."-".BAMBOO_PLANKEY." form #".START_FROM_BUILD." with ".BAMBOO_USER." user...";
+			echo "\n [INFO] Starting release notes for ".BAMBOO_PROJECTKEY."-".BAMBOO_PLANKEY." from #".START_FROM_BUILD." with ".BAMBOO_USER." user...";
 		}
 	}
 	else{
-		echo "\n [ERROR] Not running form command line \n";
+		echo "\n [ERROR] Not running from command line \n";
 		exit;
 	}
 	
 						//If there are any JIRA issues
 						if (($build->jiraIssues->size > 0)){
 							foreach($build->jiraIssues->issue as $i){
-
+								var_dump($i);
 								//Print data
 								$issueType = (isset($i->issueType)) ? $i->issueType : "Unknown";
+								$issueStatus = (isset($i->status)) ? $i->status : "Unknown";
 								$issueSummary = (isset($i->summary)) ? $i->summary : "N/A";
-								$printIssue = "[".$i->key."|".$i->url->href."] {color:#999999}(".$issueType."){color}: ".$issueSummary;
+								$issueAssignee = (isset($i->issueAssignee)) ? $i->issueAssignee : "Unknown";
+								switch ($issueStatus) {
+									case "Open":
+  										$issueStatus = "{color:#DF0101}(".$issueStatus."){color}";
+  										break;
+									case "In Progress":
+  										$issueStatus = "{color:#DF0101}(".$issueStatus."){color}";
+  										break;
+									case "Quality Review":
+										$issueStatus = "{color:#FF8000}(".$issueStatus."){color}";
+										break;
+									case "Technical Review":
+										$issueStatus = "{color:#FF8000}(".$issueStatus."){color}";
+										break;
+									case "Resolved":
+										$issueStatus = "{color:#298A08}(".$issueStatus."){color}";
+										break;
+									default:
+  										$issueStatus = "{color:#DF0101}(".$issueStatus."){color}";
+								}
+
+								$printIssue = "[".$i->key."|".$i->url->href."] ".$issueStatus." {color:#999999}(".$issueType."){color}: ".$issueSummary;
 								echo "\n              ".$printIssue;
 
 								//Populate the data
 		return json_decode($response);
 	}
 	
-?>
+?>