src/Jira/Api.php
public function findVersionByName($project_key, $name)
	{
		// Fetch all versions of this project.
		$versions = $this->getVersions($project_key);

		// Filter results on the name.
		$matching_versions = array_filter($versions, function (array $version) use ($name) {
			return $version['name'] == $name;
		});

		// Early out for no results.
		if ( empty($matching_versions) ) {
			return null;
		}

		// Multiple results should not happen since name is unique.
		return reset($matching_versions);
	}
public function findVersionByName($project_key, $name)
	{
		// Fetch all versions of this project.
		$versions = $this->getVersions($project_key);

		// Filter results on the name.
		$matching_versions = array_filter($versions, function (array $version) use ($name) {
			return $version['name'] == $name;
		});

		// Early out for no results.
		if ( empty($matching_versions) ) {
			return null;
		}

		// Multiple results should not happen since name is unique.
		return reset($matching_versions);
	}
public function findVersionByName ( $ project_key , $ name ) { // Fetch all versions of this project. $ versions = $ this -> getVersions ( $ project_key ) ; // Filter results on the name. $ matching_versions = array_filter ( $ versions , function ( array $ version ) use ( $ name ) { return $ version [ 'name' ] == $ name ; } ) ; // Early out for no results. if ( empty ( $ matching_versions ) ) { return null ; } // Multiple results should not happen since name is unique. return reset ( $ matching_versions ) ; }
Helper method to find a specific version based on the name of the version.

@param string $project_key Project Key.
@param string $name        The version name to match on.

@return array|null Version data on match or null when there is no match.
@since  2.0.0
Helper method to find a specific version based on the name of the version .