public function create(Field $field) { $data = json_encode($field); $this->log->addInfo("Create Field=\n" . $data); $ret = $this->exec($this->uri, $data, 'POST'); $cf = $this->json_mapper->map(json_decode($ret), new Field()); return $cf; }
public function testCreateFields() { //$this->markTestSkipped(); try { $field = new Field(); $field->setName('New custom field')->setDescription('Custom field for picking groups')->setType('com.atlassian.jira.plugin.system.customfieldtypes:grouppicker')->setSearcherKey('com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher'); $fieldService = new FieldService(); $ret = $fieldService->create($field); Dumper::dump($ret); } catch (JiraException $e) { $this->assertTrue(false, 'Field Create Failed : ' . $e->getMessage()); } }