* updated field added to the jira query

* DÖNER is now sorted by modification time in reverse
* wip limit and current status in the headers
This commit is contained in:
Dávid Danyi 2017-09-01 11:44:51 +02:00
parent 6ecc186a9f
commit 88527e4ff1
4 changed files with 40 additions and 1 deletions

View File

@ -22,6 +22,7 @@ return [
'assignee', 'assignee',
'status', 'status',
'worklog', 'worklog',
'updated',
'customfield_10010', 'customfield_10010',
'customfield_11226', 'customfield_11226',
'customfield_10840', 'customfield_10840',

View File

@ -228,6 +228,18 @@ class KanbanBoard implements \JsonSerializable
return $toSort; return $toSort;
} }
/**
* @param KanbanEntry[] $toSort
* @return KanbanEntry[]
*/
private function updatedAtReverseSort(array $toSort): array
{
usort($toSort, function(KanbanEntry $a, KanbanEntry $b){
return $b->getUpdatedAt() <=> $a->getUpdatedAt();
});
return $toSort;
}
/** /**
* @return array * @return array
*/ */
@ -237,7 +249,7 @@ class KanbanBoard implements \JsonSerializable
'inbox' => $this->prioSort($this->inbox->getValues()), 'inbox' => $this->prioSort($this->inbox->getValues()),
'inProgress' => $this->prioSort($this->inProgress->getValues()), 'inProgress' => $this->prioSort($this->inProgress->getValues()),
'verification' => $this->prioSort($this->verification->getValues()), 'verification' => $this->prioSort($this->verification->getValues()),
'done' => $this->prioSort($this->done->getValues()), 'done' => $this->updatedAtReverseSort($this->done->getValues()),
]; ];
} }
} }

View File

@ -122,6 +122,11 @@ class KanbanEntry implements \JsonSerializable
*/ */
private $daysBlocked = 0; private $daysBlocked = 0;
/**
* @var \DateTime
*/
private $updatedAt;
/** /**
* KanbanEntry constructor. * KanbanEntry constructor.
*/ */
@ -532,6 +537,24 @@ class KanbanEntry implements \JsonSerializable
return $this; return $this;
} }
/**
* @return \DateTime
*/
public function getUpdatedAt(): ?\DateTime
{
return $this->updatedAt;
}
/**
* @param \DateTime $updatedAt
* @return KanbanEntry
*/
public function setUpdatedAt(?\DateTime $updatedAt): KanbanEntry
{
$this->updatedAt = $updatedAt;
return $this;
}
/** /**
* @return array * @return array
*/ */
@ -559,6 +582,7 @@ class KanbanEntry implements \JsonSerializable
'answerCode' => $this->getAnswerCode(), 'answerCode' => $this->getAnswerCode(),
'worklog' => $this->getWorklog(), 'worklog' => $this->getWorklog(),
'daysBlocked' => $this->getDaysBlocked(), 'daysBlocked' => $this->getDaysBlocked(),
'updatedAt' => $this->getUpdatedAt(),
]; ];
} }
} }

View File

@ -182,6 +182,8 @@ class JiraCollectorService
unset($jiraIssueType); unset($jiraIssueType);
} }
$kanbanEntry->setUpdatedAt(new \DateTime($jsonIssue['fields']['updated']));
switch($jiraStatus->getName()) { switch($jiraStatus->getName()) {
case "Backlog": case "Backlog":
$kanbanBoard->addInbox($kanbanEntry); $kanbanBoard->addInbox($kanbanEntry);