Commit 4a221a11 authored by cividesk's avatar cividesk

jira: get security level

parent fb90551d
...@@ -602,6 +602,7 @@ CREATE TABLE IF NOT EXISTS `jira_issue` ( ...@@ -602,6 +602,7 @@ CREATE TABLE IF NOT EXISTS `jira_issue` (
`summary` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `summary` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, `type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`priority` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, `priority` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`security` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`reporter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `reporter` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`assignee` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `assignee` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `status` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
...@@ -610,17 +611,18 @@ CREATE TABLE IF NOT EXISTS `jira_issue` ( ...@@ -610,17 +611,18 @@ CREATE TABLE IF NOT EXISTS `jira_issue` (
`updated` datetime DEFAULT NULL, `updated` datetime DEFAULT NULL,
`resolved` datetime DEFAULT NULL, `resolved` datetime DEFAULT NULL,
PRIMARY KEY (`jira_id`), PRIMARY KEY (`jira_id`),
KEY `project` (`project`),
UNIQUE KEY `issue` (`issue`), UNIQUE KEY `issue` (`issue`),
KEY `created` (`created`), KEY `type` (`type`),
KEY `resolved` (`resolved`), KEY `priority` (`priority`),
KEY `security` (`security`),
KEY `reporter` (`reporter`), KEY `reporter` (`reporter`),
KEY `assignee` (`assignee`), KEY `assignee` (`assignee`),
KEY `status` (`status`), KEY `status` (`status`),
KEY `resolution` (`resolution`), KEY `resolution` (`resolution`),
KEY `type` (`type`), KEY `created` (`created`),
KEY `priority` (`priority`), KEY `updated` (`updated`),
KEY `project` (`project`), KEY `resolved` (`resolved`)
KEY `updated` (`updated`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- -------------------------------------------------------- -- --------------------------------------------------------
......
...@@ -66,7 +66,7 @@ foreach($repos as $repo) { ...@@ -66,7 +66,7 @@ foreach($repos as $repo) {
// Now update all user records // Now update all user records
echo "Updating users ..."; echo "Updating users ...";
echo $updated = $skipped = 0; $updated = $skipped = 0;
$query = "SELECT DISTINCT author_login FROM github_commit WHERE author_login > ''"; $query = "SELECT DISTINCT author_login FROM github_commit WHERE author_login > ''";
foreach ($dbh->query($query) as $row) { foreach ($dbh->query($query) as $row) {
$client->setPage(); // reinitialize the results pager $client->setPage(); // reinitialize the results pager
......
...@@ -10,8 +10,8 @@ $stm_id = $dbh->prepare(" ...@@ -10,8 +10,8 @@ $stm_id = $dbh->prepare("
DELETE FROM jira_issue WHERE issue=:issue DELETE FROM jira_issue WHERE issue=:issue
"); ");
$stm_ii = $dbh->prepare(" $stm_ii = $dbh->prepare("
INSERT INTO jira_issue (jira_id, project, issue, summary, type, priority, reporter, assignee, status, resolution, created, updated, resolved) INSERT INTO jira_issue (jira_id, project, issue, summary, type, priority, security, reporter, assignee, status, resolution, created, updated, resolved)
VALUES (:jira_id, :project, :issue, :summary, :type, :priority, :reporter, :assignee, :status, :resolution, :created, :updated, :resolved); VALUES (:jira_id, :project, :issue, :summary, :type, :priority, :security, :reporter, :assignee, :status, :resolution, :created, :updated, :resolved);
"); ");
$stm_vd = $dbh->prepare(" $stm_vd = $dbh->prepare("
DELETE FROM jira_version WHERE issue=:issue; DELETE FROM jira_version WHERE issue=:issue;
...@@ -51,6 +51,8 @@ foreach ($projects as $project) { ...@@ -51,6 +51,8 @@ foreach ($projects as $project) {
$stm_ii->bindParam(':type', $issueType['name']); $stm_ii->bindParam(':type', $issueType['name']);
$priority = $issue->getPriority(); $priority = $issue->getPriority();
$stm_ii->bindParam(':priority', $priority['name']); $stm_ii->bindParam(':priority', $priority['name']);
$security = $issue->get('Security Level');
$stm_ii->bindValue(':security', $security ? $security['name'] : NULL);
$reporter = $issue->getReporter(); $reporter = $issue->getReporter();
$stm_ii->bindParam(':reporter', $reporter['name']); $stm_ii->bindParam(':reporter', $reporter['name']);
$assignee = $issue->getAssignee(); $assignee = $issue->getAssignee();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment