Jira-integration: to get all labels from jira database

At this moment Jira Webservice doesn't support get Jira labels. This is a workaround
for getting jira labels. The php script gets all distinct labels from jira database
This commit is contained in:
Miciele Ghiorghis 2012-10-24 15:33:47 +02:00 committed by Manuel Rego Casasnovas
parent 5171d028fe
commit 0c0ad5f3c2

View file

@ -0,0 +1,28 @@
<?php
$host="domain:port";
$dbuser="username";
$dbpass="password";
$dbname="jiradb";
$conn = mysql_connect($host, $dbuser, $dbpass)
or die("Connection Failed");
mysql_select_db($dbname, $conn) or die ($dbname . " Database not found. ");
$query = "SELECT DISTINCT label FROM label";
$result = mysql_db_query($dbname, $query) or die("Failed Query " . $query);
$resp = "";
while($row = mysql_fetch_row($result)) {
$label = $row[0];
$label = str_replace("\r\n", "", $label);
$resp .= $label . ",";
}
mysql_close($conn);
$resp = substr_replace($resp ,"",-1);
echo $resp;
?>