@@ -222,6 +222,7 @@ public function getRoleDetails($projectKey, $roleId)
222222 * @param $issuetypeIds array Combined with issuetypeNames, lists the issue types with which to filter the results.
223223 * If null, all issue types are returned. Specifiying an issue type that does not exist is
224224 * not an error.
225+ *
225226 * @param $issuetypeNames array Combined with issuetypeIds, lists the issue types with which to filter the results.
226227 * If null, all issue types are returned. This parameter can be specified multiple times,
227228 * but is NOT interpreted as a comma-separated list. Specifiying an issue type that does
@@ -487,6 +488,8 @@ public function createVersion($projectId, $name, $options = array())
487488
488489 /**
489490 * Update JIRA Version
491+ *
492+ * https://docs.atlassian.com/jira/REST/latest/#api/2/version-updateVersion
490493 *
491494 * @param int $versionId Version identifier
492495 * @param array $params Key->Value list to update the version with.
@@ -497,6 +500,32 @@ public function updateVersion($versionId, $params = array()) {
497500 return $ this ->api (self ::REQUEST_PUT , sprintf ('/rest/api/2/version/%d ' , $ versionId ), $ params );
498501 }
499502
503+ /**
504+ * Shorthand to mark a version as Released
505+ *
506+ * @param int $versionId Version identifier
507+ * @param string|null $releaseDate Date in Y-m-d format. Defaults to today
508+ * @param array $params Optionally extra parameters.
509+ *
510+ * @return Result|false
511+ */
512+ public function releaseVersion ($ versionId , $ releaseDate = null , $ params = array ()) {
513+ if (!$ releaseDate ) {
514+ $ releaseDate = date ("Y-m-d " );
515+ }
516+
517+ // TODO Not entirely sure what to do yet with userReleaseDate
518+ $ params = array_merge (
519+ array (
520+ "releaseDate " => $ releaseDate ,
521+ 'released ' => true
522+ ),
523+ $ params
524+ );
525+
526+ return $ this ->updateVersion ($ versionId , $ params );
527+ }
528+
500529 /**
501530 * Create JIRA Attachment
502531 *
0 commit comments