Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
Create task to the first active swimlane
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Feb 9, 2016
1 parent e18ff99 commit ad587ee
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions EmailHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
));
}

Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit ad587ee

Please sign in to comment.