* jira migration update, customfields changed

This commit is contained in:
Dávid Danyi 2018-08-06 17:01:08 +02:00
parent efb5004cd3
commit 18b0aab20c
2 changed files with 45 additions and 58 deletions

View File

@ -38,7 +38,6 @@ class KanbanEntry implements \JsonSerializable
private $assignee; private $assignee;
/** /**
* JIRA: customfield_10401
* @var JiraAssignee[] * @var JiraAssignee[]
*/ */
private $additionalAssignees; private $additionalAssignees;
@ -64,74 +63,62 @@ class KanbanEntry implements \JsonSerializable
private $fixVersions; private $fixVersions;
/** /**
* JIRA: customfield_11226
* @var int * @var int
*/ */
private $prio; private $prio;
/** /**
* JIRA: customfield_11225
* @var string[]|ArrayCollection * @var string[]|ArrayCollection
*/ */
private $functionalAreas; private $functionalAreas;
/** /**
* JIRA: customfield_10010
* @var string * @var string
*/ */
private $externalId; private $externalId;
/** /**
* JIRA: customfield_10850
* @var string * @var string
*/ */
private $externalLink; private $externalLink;
/** /**
* JIRA: customfield_10840
* @var string * @var string
*/ */
private $project; private $project;
/** /**
* JIRA: customfield_10844
* @var string * @var string
*/ */
private $mhwebStatus; private $mhwebStatus;
/** /**
* JIRA: customfield_10847
* @var bool * @var bool
*/ */
private $mhwebHot; private $mhwebHot;
/** /**
* JIRA: customfield_10849
* @var bool * @var bool
*/ */
private $mhwebExternal = false; private $mhwebExternal = false;
/** /**
* JIRA: customfield_10904
* @var string * @var string
*/ */
private $team; private $team;
/** /**
* JIRA: customfield_11692
* @var string * @var string
*/ */
private $answerCode; private $answerCode;
/** /**
* ITS OVER 9000! * ITS OVER 9000!
* JIRA: customfield_12500
* @var int * @var int
*/ */
private $taurusPrio = 9001; private $taurusPrio = 9001;
/** /**
* JIRA: customfield_10004 in task in customfield_10001 of parent
* @var string * @var string
*/ */
private $epicName; private $epicName;
@ -693,16 +680,16 @@ class KanbanEntry implements \JsonSerializable
'issuePriority' => $this->getIssuePriority(), 'issuePriority' => $this->getIssuePriority(),
'issuePriorityIcon' => $this->getIssuePriorityIcon(), 'issuePriorityIcon' => $this->getIssuePriorityIcon(),
'labels' => $this->getLabels(), 'labels' => $this->getLabels(),
'prio' => $this->getPrio(), // 'prio' => $this->getPrio(),
'functionalArea' => $this->getFunctionalAreas()->getValues(), // 'functionalArea' => $this->getFunctionalAreas()->getValues(),
'externalId' => $this->getExternalId(), // 'externalId' => $this->getExternalId(),
'externalLink' => $this->getExternalLink(), // 'externalLink' => $this->getExternalLink(),
'project' => $this->getProject(), // 'project' => $this->getProject(),
'mhwebStatus' => $this->getMhwebStatus(), // 'mhwebStatus' => $this->getMhwebStatus(),
'mhwebHot' => $this->getMhwebHot(), // 'mhwebHot' => $this->getMhwebHot(),
'mhwebExternal' => $this->getMhwebExternal(), // 'mhwebExternal' => $this->getMhwebExternal(),
'team' => $this->getTeam(), // 'team' => $this->getTeam(),
'answerCode' => $this->getAnswerCode(), // 'answerCode' => $this->getAnswerCode(),
'taurusPrio' => $this->getTaurusPrio(), 'taurusPrio' => $this->getTaurusPrio(),
'worklog' => $this->getWorklog(), 'worklog' => $this->getWorklog(),
'daysBlocked' => $this->getDaysBlocked(), 'daysBlocked' => $this->getDaysBlocked(),

View File

@ -154,8 +154,8 @@ class JiraCollectorService
} }
$parsedJsonParentData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY); $parsedJsonParentData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY);
if ($parsedJsonParentData['fields']['customfield_10001']) { if ($parsedJsonParentData['fields']['customfield_11711']) {
$jiraIssueUri = sprintf($jiraIssueBaseUrl, $parsedJsonParentData['fields']['customfield_10001']); $jiraIssueUri = sprintf($jiraIssueBaseUrl, $parsedJsonParentData['fields']['customfield_11711']);
$response = $this->httpClient $response = $this->httpClient
->setUri($jiraIssueUri) ->setUri($jiraIssueUri)
->setAuth($user, $password) ->setAuth($user, $password)
@ -166,7 +166,7 @@ class JiraCollectorService
} }
$parsedJsonEpicData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY); $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]; return $this->cachedEpics[$parentKey];
} }
$this->cachedEpics[$parentKey] = null; $this->cachedEpics[$parentKey] = null;
@ -188,9 +188,9 @@ class JiraCollectorService
$kanbanEntry->setId(intval($jsonIssue['id'])) $kanbanEntry->setId(intval($jsonIssue['id']))
->setKey($jsonIssue['key']) ->setKey($jsonIssue['key'])
->setSummary($jsonIssue['fields']['summary']) ->setSummary($jsonIssue['fields']['summary'])
->setExternalLink($jsonIssue['fields']['customfield_10850']) // ->setExternalLink($jsonIssue['fields']['customfield_10850'])
->setMhwebStatus($jsonIssue['fields']['customfield_10844']) // ->setMhwebStatus($jsonIssue['fields']['customfield_10844'])
->setAnswerCode($jsonIssue['fields']['customfield_11692']) // ->setAnswerCode($jsonIssue['fields']['customfield_11692'])
->setIssuePriority($jsonIssue['fields']['priority']['name']) ->setIssuePriority($jsonIssue['fields']['priority']['name'])
->setIssuePriorityIcon($jsonIssue['fields']['priority']['iconUrl']) ->setIssuePriorityIcon($jsonIssue['fields']['priority']['iconUrl'])
->setLabels($jsonIssue['fields']['labels']) ->setLabels($jsonIssue['fields']['labels'])
@ -212,9 +212,9 @@ class JiraCollectorService
}, $jsonIssue['fields']['worklog']['worklogs']); }, $jsonIssue['fields']['worklog']['worklogs']);
$kanbanEntry->setDaysBlocked(ceil($secondsBlocked / 28800)); $kanbanEntry->setDaysBlocked(ceil($secondsBlocked / 28800));
// additional assignees : customfield_10401 // additional assignees : customfield_13662
if (isset($jsonIssue['fields']['customfield_10401'])) { if (isset($jsonIssue['fields']['customfield_13662'])) {
foreach ($jsonIssue['fields']['customfield_10401'] as $assignee) { foreach ($jsonIssue['fields']['customfield_13662'] as $assignee) {
$avatarUrl = $this->router->generateUri('user.avatar', [ $avatarUrl = $this->router->generateUri('user.avatar', [
'signum' => $assignee['key'], 'signum' => $assignee['key'],
]); ]);
@ -230,7 +230,7 @@ class JiraCollectorService
} }
// epicName: has parent, and parent has customfield_10001 // 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']); $epicName = $this->getEpicNameFromParent($jsonIssue['key']);
$kanbanEntry->setEpicName($epicName); $kanbanEntry->setEpicName($epicName);
} elseif (isset($jsonIssue['fields']['parent'])) { } elseif (isset($jsonIssue['fields']['parent'])) {
@ -239,9 +239,9 @@ class JiraCollectorService
} }
// externalId : customfield_10010 // externalId : customfield_10010
if (isset($jsonIssue['fields']['customfield_10010'])) { // if (isset($jsonIssue['fields']['customfield_10010'])) {
$kanbanEntry->setExternalId($jsonIssue['fields']['customfield_10010']); // $kanbanEntry->setExternalId($jsonIssue['fields']['customfield_10010']);
} // }
// prio : customfield_10840 // prio : customfield_10840
if (isset($jsonIssue['fields']['customfield_11226'])) { if (isset($jsonIssue['fields']['customfield_11226'])) {
@ -249,38 +249,38 @@ class JiraCollectorService
} }
// functional area : customfield_11225 // functional area : customfield_11225
if (isset($jsonIssue['fields']['customfield_11225'])) { // if (isset($jsonIssue['fields']['customfield_11225'])) {
foreach ($jsonIssue['fields']['customfield_11225'] as $functionalArea) { // foreach ($jsonIssue['fields']['customfield_11225'] as $functionalArea) {
$kanbanEntry->addFunctionalArea($functionalArea['value']); // $kanbanEntry->addFunctionalArea($functionalArea['value']);
} // }
} // }
// project : customfield_10840 // project : customfield_10840
if (isset($jsonIssue['fields']['customfield_10840'])) { // if (isset($jsonIssue['fields']['customfield_10840'])) {
$kanbanEntry->setProject($jsonIssue['fields']['customfield_10840']['value']); // $kanbanEntry->setProject($jsonIssue['fields']['customfield_10840']['value']);
} // }
// mhweb hot : customfield_10847 // mhweb hot : customfield_10847
if (isset($jsonIssue['fields']['customfield_10847'])) { // if (isset($jsonIssue['fields']['customfield_10847'])) {
$boolVal = $jsonIssue['fields']['customfield_10847'][0]['value'] == 'yes'; // $boolVal = $jsonIssue['fields']['customfield_10847'][0]['value'] == 'yes';
$kanbanEntry->setMhwebHot($boolVal); // $kanbanEntry->setMhwebHot($boolVal);
} // }
// mhweb external : customfield_10849 // mhweb external : customfield_10849
if (isset($jsonIssue['fields']['customfield_10849'])) { // if (isset($jsonIssue['fields']['customfield_10849'])) {
$boolVal = $jsonIssue['fields']['customfield_10849'][0]['value'] == 'yes'; // $boolVal = $jsonIssue['fields']['customfield_10849'][0]['value'] == 'yes';
$kanbanEntry->setMhwebExternal($boolVal); // $kanbanEntry->setMhwebExternal($boolVal);
} // }
// team : customfield_10904 // team : customfield_10904
if (isset($jsonIssue['fields']['customfield_10904'])) { // if (isset($jsonIssue['fields']['customfield_10904'])) {
$kanbanEntry->setTeam($jsonIssue['fields']['customfield_10904']['value']); // $kanbanEntry->setTeam($jsonIssue['fields']['customfield_10904']['value']);
} // }
// team : customfield_12500 // team : customfield_12500
if (isset($jsonIssue['fields']['customfield_12500'])) { // if (isset($jsonIssue['fields']['customfield_12500'])) {
$kanbanEntry->setTaurusPrio($jsonIssue['fields']['customfield_12500']); // $kanbanEntry->setTaurusPrio($jsonIssue['fields']['customfield_12500']);
} // }
// jira status // jira status
$jiraStatus = new JiraStatus(); $jiraStatus = new JiraStatus();