public function create($fields) { parent::create($fields); $supports = ['name' => REQUIRED, 'organization_id' => OPTIONAL]; if ($this->enforce($fields, $supports)) { $req = new APIRequest($this->origin, '/v1/projects', 'POST', ['params' => $fields]); return new Project($this->origin, $req->exec()); } }
public function create($fields) { parent::create($fields); $supports = ['number' => REQUIRED]; if ($this->enforce($fields, $supports)) { $req = new APIRequest($this->origin, '/v1/projects/' . $this->project_id . '/versions', 'POST', ['params' => $fields]); return new ProjectVersion($this->origin, $req->exec()); } }
public function create($fields) { parent::create($fields); $supports = ['title' => REQUIRED, 'status_id' => REQUIRED, 'severity_id' => REQUIRED, 'project_version' => REQUIRED, 'project_version_id' => REQUIRED, 'project_section_id' => OPTIONAL, 'type_id' => OPTIONAL, 'reproducibility_id' => OPTIONAL, 'assigned_user_id' => OPTIONAL, 'description' => OPTIONAL, 'expected_results' => OPTIONAL, 'steps' => OPTIONAL, 'platform' => OPTIONAL]; if (array_key_exists('project_version_id', $fields)) { $supports['project_version'] = OPTIONAL; } elseif (array_key_exists('project_version', $fields)) { $supports['project_version_id'] = OPTIONAL; } if ($this->enforce($fields, $supports)) { $fields = array_merge(['include' => 'steps,platform'], $fields); $req = new APIRequest($this->origin, '/v1/projects/' . $this->project_id . '/bugs', 'POST', ['params' => $fields]); return new Bug($this->origin, $req->exec()); } }