/** * Create follow up issue to given issue * * @param array $issue */ public function createAction($issue) { $redmineClient = new Redmine\Client($this->settings['Redmine']['url'], $this->settings['Redmine']['apiKey']); $id = $issue['related_id']; unset($issue['related_id']); $params = $issue; // get additional issue data and assign to new issue $res = $redmineClient->api('issue')->show($id); $params['project_id'] = Arrays::getValueByPath($res, 'issue.project.id'); $params['category_id'] = Arrays::getValueByPath($res, 'issue.category.id'); $newIssue = $redmineClient->api('issue')->create($params); // create relation $relation['issue_to_id'] = $id; $relation['relation_type'] = self::RELATION_TYPE; $json = json_encode(array('relation' => $relation)); $redmineClient->post('/issues/' . (string) $newIssue->id . '/relations.json', $json); $this->view->assign('value', json_decode(json_encode((array) $newIssue), 1)); }
/** * Perform the client post() method. * * @param string $path * @param string $data * * @return string|false */ protected function post($path, $data) { return $this->client->post($path, $data); }
/** * {@inheritDoc} */ public function post($path, $data) { return $this->client->post($path, $data); }