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:
parent
5171d028fe
commit
0c0ad5f3c2
1 changed files with 28 additions and 0 deletions
28
scripts/jira-connector/jiralabels.php
Executable file
28
scripts/jira-connector/jiralabels.php
Executable 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;
|
||||||
|
?>
|
||||||
Loading…
Add table
Reference in a new issue