From ad587ee16d2a88b5b015d3e4bd6e1262d97848cb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 8 Feb 2016 21:29:34 -0500 Subject: [PATCH] Create task to the first active swimlane --- EmailHandler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/EmailHandler.php b/EmailHandler.php index 030edf3..cce581a 100644 --- a/EmailHandler.php +++ b/EmailHandler.php @@ -65,6 +65,7 @@ public function receiveEmail(array $payload) 'title' => $this->getTitle($payload), 'description' => $this->getDescription($payload), 'creator_id' => $user['id'], + 'swimlane_id' => $this->getSwimlaneId($project), )); } @@ -141,6 +142,19 @@ public function getDescription(array $payload) return ''; } + /** + * Get swimlane id + * + * @access public + * @param array $project + * @return string + */ + public function getSwimlaneId(array $project) + { + $swimlanes = $this->swimlane->getList($project['id'], false, true); + return count($swimlanes) > 0 ? key($swimlanes) : 0; + } + /** * Get API token *