From 18b0aab20c82f47772c1022f438fc443321b9182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Mon, 6 Aug 2018 17:01:08 +0200 Subject: [PATCH] * jira migration update, customfields changed --- src/App/Entity/KanbanEntry.php | 33 ++++------- src/App/Service/JiraCollectorService.php | 70 ++++++++++++------------ 2 files changed, 45 insertions(+), 58 deletions(-) diff --git a/src/App/Entity/KanbanEntry.php b/src/App/Entity/KanbanEntry.php index 22b8f27..c06dbb0 100644 --- a/src/App/Entity/KanbanEntry.php +++ b/src/App/Entity/KanbanEntry.php @@ -38,7 +38,6 @@ class KanbanEntry implements \JsonSerializable private $assignee; /** - * JIRA: customfield_10401 * @var JiraAssignee[] */ private $additionalAssignees; @@ -64,74 +63,62 @@ class KanbanEntry implements \JsonSerializable private $fixVersions; /** - * JIRA: customfield_11226 * @var int */ private $prio; /** - * JIRA: customfield_11225 * @var string[]|ArrayCollection */ private $functionalAreas; /** - * JIRA: customfield_10010 * @var string */ private $externalId; /** - * JIRA: customfield_10850 * @var string */ private $externalLink; /** - * JIRA: customfield_10840 * @var string */ private $project; /** - * JIRA: customfield_10844 * @var string */ private $mhwebStatus; /** - * JIRA: customfield_10847 * @var bool */ private $mhwebHot; /** - * JIRA: customfield_10849 * @var bool */ private $mhwebExternal = false; /** - * JIRA: customfield_10904 * @var string */ private $team; /** - * JIRA: customfield_11692 * @var string */ private $answerCode; /** * ITS OVER 9000! - * JIRA: customfield_12500 * @var int */ private $taurusPrio = 9001; /** - * JIRA: customfield_10004 in task in customfield_10001 of parent * @var string */ private $epicName; @@ -693,16 +680,16 @@ class KanbanEntry implements \JsonSerializable 'issuePriority' => $this->getIssuePriority(), 'issuePriorityIcon' => $this->getIssuePriorityIcon(), 'labels' => $this->getLabels(), - 'prio' => $this->getPrio(), - 'functionalArea' => $this->getFunctionalAreas()->getValues(), - 'externalId' => $this->getExternalId(), - 'externalLink' => $this->getExternalLink(), - 'project' => $this->getProject(), - 'mhwebStatus' => $this->getMhwebStatus(), - 'mhwebHot' => $this->getMhwebHot(), - 'mhwebExternal' => $this->getMhwebExternal(), - 'team' => $this->getTeam(), - 'answerCode' => $this->getAnswerCode(), +// 'prio' => $this->getPrio(), +// 'functionalArea' => $this->getFunctionalAreas()->getValues(), +// 'externalId' => $this->getExternalId(), +// 'externalLink' => $this->getExternalLink(), +// 'project' => $this->getProject(), +// 'mhwebStatus' => $this->getMhwebStatus(), +// 'mhwebHot' => $this->getMhwebHot(), +// 'mhwebExternal' => $this->getMhwebExternal(), +// 'team' => $this->getTeam(), +// 'answerCode' => $this->getAnswerCode(), 'taurusPrio' => $this->getTaurusPrio(), 'worklog' => $this->getWorklog(), 'daysBlocked' => $this->getDaysBlocked(), diff --git a/src/App/Service/JiraCollectorService.php b/src/App/Service/JiraCollectorService.php index ed36cb5..7eb3419 100644 --- a/src/App/Service/JiraCollectorService.php +++ b/src/App/Service/JiraCollectorService.php @@ -154,8 +154,8 @@ class JiraCollectorService } $parsedJsonParentData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY); - if ($parsedJsonParentData['fields']['customfield_10001']) { - $jiraIssueUri = sprintf($jiraIssueBaseUrl, $parsedJsonParentData['fields']['customfield_10001']); + if ($parsedJsonParentData['fields']['customfield_11711']) { + $jiraIssueUri = sprintf($jiraIssueBaseUrl, $parsedJsonParentData['fields']['customfield_11711']); $response = $this->httpClient ->setUri($jiraIssueUri) ->setAuth($user, $password) @@ -166,7 +166,7 @@ class JiraCollectorService } $parsedJsonEpicData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY); - $this->cachedEpics[$parentKey] = $parsedJsonEpicData['fields']['customfield_10004']; + $this->cachedEpics[$parentKey] = $parsedJsonEpicData['fields']['customfield_11712']; return $this->cachedEpics[$parentKey]; } $this->cachedEpics[$parentKey] = null; @@ -188,9 +188,9 @@ class JiraCollectorService $kanbanEntry->setId(intval($jsonIssue['id'])) ->setKey($jsonIssue['key']) ->setSummary($jsonIssue['fields']['summary']) - ->setExternalLink($jsonIssue['fields']['customfield_10850']) - ->setMhwebStatus($jsonIssue['fields']['customfield_10844']) - ->setAnswerCode($jsonIssue['fields']['customfield_11692']) +// ->setExternalLink($jsonIssue['fields']['customfield_10850']) +// ->setMhwebStatus($jsonIssue['fields']['customfield_10844']) +// ->setAnswerCode($jsonIssue['fields']['customfield_11692']) ->setIssuePriority($jsonIssue['fields']['priority']['name']) ->setIssuePriorityIcon($jsonIssue['fields']['priority']['iconUrl']) ->setLabels($jsonIssue['fields']['labels']) @@ -212,9 +212,9 @@ class JiraCollectorService }, $jsonIssue['fields']['worklog']['worklogs']); $kanbanEntry->setDaysBlocked(ceil($secondsBlocked / 28800)); - // additional assignees : customfield_10401 - if (isset($jsonIssue['fields']['customfield_10401'])) { - foreach ($jsonIssue['fields']['customfield_10401'] as $assignee) { + // additional assignees : customfield_13662 + if (isset($jsonIssue['fields']['customfield_13662'])) { + foreach ($jsonIssue['fields']['customfield_13662'] as $assignee) { $avatarUrl = $this->router->generateUri('user.avatar', [ 'signum' => $assignee['key'], ]); @@ -230,7 +230,7 @@ class JiraCollectorService } // epicName: has parent, and parent has customfield_10001 - if (isset($jsonIssue['fields']['customfield_10001'])) { + if (isset($jsonIssue['fields']['customfield_11711'])) { $epicName = $this->getEpicNameFromParent($jsonIssue['key']); $kanbanEntry->setEpicName($epicName); } elseif (isset($jsonIssue['fields']['parent'])) { @@ -239,9 +239,9 @@ class JiraCollectorService } // externalId : customfield_10010 - if (isset($jsonIssue['fields']['customfield_10010'])) { - $kanbanEntry->setExternalId($jsonIssue['fields']['customfield_10010']); - } +// if (isset($jsonIssue['fields']['customfield_10010'])) { +// $kanbanEntry->setExternalId($jsonIssue['fields']['customfield_10010']); +// } // prio : customfield_10840 if (isset($jsonIssue['fields']['customfield_11226'])) { @@ -249,38 +249,38 @@ class JiraCollectorService } // functional area : customfield_11225 - if (isset($jsonIssue['fields']['customfield_11225'])) { - foreach ($jsonIssue['fields']['customfield_11225'] as $functionalArea) { - $kanbanEntry->addFunctionalArea($functionalArea['value']); - } - } +// if (isset($jsonIssue['fields']['customfield_11225'])) { +// foreach ($jsonIssue['fields']['customfield_11225'] as $functionalArea) { +// $kanbanEntry->addFunctionalArea($functionalArea['value']); +// } +// } // project : customfield_10840 - if (isset($jsonIssue['fields']['customfield_10840'])) { - $kanbanEntry->setProject($jsonIssue['fields']['customfield_10840']['value']); - } +// if (isset($jsonIssue['fields']['customfield_10840'])) { +// $kanbanEntry->setProject($jsonIssue['fields']['customfield_10840']['value']); +// } // mhweb hot : customfield_10847 - if (isset($jsonIssue['fields']['customfield_10847'])) { - $boolVal = $jsonIssue['fields']['customfield_10847'][0]['value'] == 'yes'; - $kanbanEntry->setMhwebHot($boolVal); - } +// if (isset($jsonIssue['fields']['customfield_10847'])) { +// $boolVal = $jsonIssue['fields']['customfield_10847'][0]['value'] == 'yes'; +// $kanbanEntry->setMhwebHot($boolVal); +// } // mhweb external : customfield_10849 - if (isset($jsonIssue['fields']['customfield_10849'])) { - $boolVal = $jsonIssue['fields']['customfield_10849'][0]['value'] == 'yes'; - $kanbanEntry->setMhwebExternal($boolVal); - } +// if (isset($jsonIssue['fields']['customfield_10849'])) { +// $boolVal = $jsonIssue['fields']['customfield_10849'][0]['value'] == 'yes'; +// $kanbanEntry->setMhwebExternal($boolVal); +// } // team : customfield_10904 - if (isset($jsonIssue['fields']['customfield_10904'])) { - $kanbanEntry->setTeam($jsonIssue['fields']['customfield_10904']['value']); - } +// if (isset($jsonIssue['fields']['customfield_10904'])) { +// $kanbanEntry->setTeam($jsonIssue['fields']['customfield_10904']['value']); +// } // team : customfield_12500 - if (isset($jsonIssue['fields']['customfield_12500'])) { - $kanbanEntry->setTaurusPrio($jsonIssue['fields']['customfield_12500']); - } +// if (isset($jsonIssue['fields']['customfield_12500'])) { +// $kanbanEntry->setTaurusPrio($jsonIssue['fields']['customfield_12500']); +// } // jira status $jiraStatus = new JiraStatus();