public function transform($task) { return ['subject' => $this->_getTitle($task), 'status_id' => map_status($task['status']['name'], strtolower($task['vendor']), $this->vendor), 'parent_issue_id' => config('redmine.import.parent_task'), 'priority_id' => map_prio($task['priority']['id'], strtolower($task['vendor']), $this->vendor), 'assigned_to_id' => map_user($task['assigned_to']['name'], strtolower($task['vendor']), $this->vendor), 'watcher_user_ids' => config('redmine.import.watchers'), 'description' => $task['link'], 'due_date' => $this->_getTaskDueDate($task), 'custom_fields' => $this->_getCustomFields($task)]; }
/** * GitHub cannot create closed issues, so we check for status right after creation, * and update if necessary. * * @param $issue * @param $task */ private function updateStatus(&$issue, $task) { $status = map_status($task['status']['name'], strtolower($task['vendor']), $this->vendor); $issue['state'] = $status; $this->github->updateTask($issue['number'], ['state' => $status]); }