File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,26 @@ class VersionService extends \JiraRestApi\JiraClient
1111 private $ uri = '/version ' ;
1212
1313 /**
14- * create version.
14+ * Function to create a new project version.
1515 *
16- * @see https://docs.atlassian.com/jira/REST/server/#api/2/version-createVersion
16+ * @param Version|array $version
17+ *
18+ * @throws \JiraRestApi\JiraException
19+ * @throws \JsonMapper_Exception
20+ *
21+ * @return Version|object Version class
1722 */
1823 public function create ($ version )
1924 {
20- throw new JiraException ('create version not yet implemented ' );
25+ $ data = json_encode ($ version );
26+
27+ $ this ->log ->addInfo ("Create Version= \n" .$ data );
28+
29+ $ ret = $ this ->exec ($ this ->uri , $ data , 'POST ' );
30+
31+ return $ this ->json_mapper ->map (
32+ json_decode ($ ret ), new Version ()
33+ );
2134 }
2235
2336 /**
You can’t perform that action at this time.
0 commit comments