java.lang.Object | |
↳ | com.atlassian.jira.bc.project.version.DefaultVersionService |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Takes a validation result and performs the archive operation.
| |||||||||||
Creates a new
Version , based on the validation result from calling #validateCreate(User,
VersionBuilder). | |||||||||||
Using the validation result from #validateCreateVersion(User, com.atlassian.jira.project.Project, String,
String, String, Long) a new version will be created.
| |||||||||||
Move a version to have a higher sequence number - ie make it later.
| |||||||||||
Deletes a version from a project.
| |||||||||||
Return the count of Issues that affect this version.
| |||||||||||
Return the count of Issues Fixed in this version.
| |||||||||||
Return the count of Issues that are unresolved in this version.
| |||||||||||
Used to retrieve a
Version object by version id. | |||||||||||
This method returns all versions for a given project.
| |||||||||||
This method returns all versions for a given project.
| |||||||||||
Move a version to have a lower sequence number - ie make it earlier.
| |||||||||||
Is the passed version overdue? This method does no permission checks on the passed version.
| |||||||||||
Merges a version into another, then removes the original version.
| |||||||||||
Move a version to the end of the version sequence.
| |||||||||||
Move a version to the start of the version list.
| |||||||||||
Using the validation result from #validateReleaseVersion(User, com.atlassian.jira.project.version.Version,
Date) a version will be released.
| |||||||||||
Move a version after another version.
| |||||||||||
Creates a builder to be used when updating an existing
Version . | |||||||||||
Creates a builder to be used when creating a new
Version . | |||||||||||
Using the validation result from #validateReleaseVersion(User, com.atlassian.jira.project.version.Version,
Date) a version will be released.
| |||||||||||
Modify the release date of a version without performing a release/unrelease.
| |||||||||||
Modify the release date of a version without performing a release/unrelease.
| |||||||||||
Set the name and description of a version, if you have edit permission.
| |||||||||||
Takes a validation result and performs the unarchive operation.
| |||||||||||
Using the validation result from #validateUnreleaseVersion(User, com.atlassian.jira.project.version.Version,
Date) a version will be unreleased.
| |||||||||||
Updates the existing
Version , based on the validation result from calling #validateUpdate(User,
VersionBuilder). | |||||||||||
This method should be called before archiving a version.
| |||||||||||
Validates the creation of a new
Version object, specified with a VersionBuilder . | |||||||||||
This method needs to be called before creating a version to ensure all parameters are correct.
| |||||||||||
This method needs to be called before creating a version to ensure all parameters are correct.
| |||||||||||
Validate Move a version to have a higher sequence number - ie make it later.
| |||||||||||
Validates an attempt to delete a version from a project.
| |||||||||||
Validate Move a version to have a lower sequence number - ie make it earlier.
| |||||||||||
Implementation is the same as deleting, with the actions set to SWAP and the swapVersionId being passed as both
Affects Version swap and Fix Version swap
| |||||||||||
Validate Move a version to the end of the version sequence.
| |||||||||||
Validate Move a version to the start of the version list.
| |||||||||||
Validate Move a version after another version.
| |||||||||||
Validate the release date of a version without performing a release/unrelease.
| |||||||||||
This method needs to be called before releasing a version to ensure all parameters are correct.
| |||||||||||
This method needs to be called before releasing a version to ensure all parameters are correct.
| |||||||||||
This method should be called before unarchiving a version.
| |||||||||||
This method needs to be called before unreleasing a version to ensure all parameters are correct.
| |||||||||||
This method needs to be called before unreleasing a version to ensure all parameters are correct.
| |||||||||||
Validates the update of an existing
Version object, specified with a VersionBuilder . | |||||||||||
Validate the name and description of a version, if you have edit permission.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parses a string release date into a Date object, throwing an exception if there is a problem parsing the string.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Takes a validation result and performs the archive operation.
result | The result from the validation |
---|
Creates a new Version
, based on the validation result from calling #validateCreate(User,
VersionBuilder).
user | the user |
---|---|
validationResult | the result of validation |
Using the validation result from #validateCreateVersion(User, com.atlassian.jira.project.Project, String, String, String, Long) a new version will be created. This method will throw an RuntimeException if the version could not be created.
user | The user trying to get a version |
---|---|
request | The VersionService.CreateVersionValidationResult
object containing all required data |
Move a version to have a higher sequence number - ie make it later.
moveVersionValidationResult | Move Version Validation Result |
---|
Deletes a version from a project. When deleting a version, we need to decide what to do with issues that reference the version in their Affects of Fix Version fields. The action taken is specified as a flag for each field.
context | The context for this service call. |
---|---|
result | The result of validation, which contains the version to be deleted, and the swap versions for Affects and Fix fields |
Return the count of Issues that affect this version.
Return the count of Issues Fixed in this version.
Return the count of Issues that are unresolved in this version. Used when releasing a version to get user confirmation about what to do with the unresolved issues.
user | the user trying to get the count |
---|---|
version | which version to check for unresolved issues |
Used to retrieve a Version
object by version id. This method returns a
VersionService.VersionResult
. The version will be null if no
version for the id specified can be found, or if the user making the request does not have the ADMIN,
PROJECT_ADMIN or BROWSE project permission for the project. In both of these cases, the errorCollection in the
result object will contain an appropriate error message.
user | The user trying to get a version |
---|---|
versionId | The id of requested version |
Used to retrieve a Version
object by version id within project
specified by Project
object. This method returns a VersionService.VersionResult
. The version will be null if no version for
the id specified can be found, or if the user making the request does not have the ADMIN, PROJECT_ADMIN or BROWSE
project permission for the project. In both of these cases, the errorCollection in the result object will contain
an appropriate error message.
user | The user trying to get a version |
---|---|
project | The project object containing requested version |
versionId | The id of requested version |
Used to retrieve a Version
object by version name within project
specified by Project
object. This method returns a VersionService.VersionResult
. The version will be null if no version for
the versionName specified can be found, or if the user making the request does not have the ADMIN, PROJECT_ADMIN
or BROWSE project permission for the project. In both of these cases, the errorCollection in the result object
will contain an appropriate error message.
user | The user trying to get a version |
---|---|
project | The project object containing requested version |
versionName | The name of requested version |
This method returns all versions for a given project. It's similar to the VersionService#getVersionsByProject(ApplicationUser, Project) but the results it returns are paged.
It also provides the possibility to sort the results by the fields specified in the VersionService.VersionExtractableField
class.
The user making the request must have the ADMIN, PROJECT_ADMIN or BROWSE project permissions for the project. Otherwise, the errorCollection in the result object will contain an appropriate error message.
user | The user trying to get a version |
---|---|
project | The project object containing requested version |
pageRequest | details of a page to return (offset, max number of results) |
orderBy | details on how to order the results |
Used to retrieve a Version
collection within project specified by
Project
object. This method returns a VersionService.VersionsResult
. The versions collection will be empty if
the user making the request does not have the ADMIN, PROJECT_ADMIN or BROWSE project permission for the project.
In this case, the errorCollection in the result object will contain an appropriate error message.
user | The user trying to get a version |
---|---|
project | The project object containing requested version |
This method returns all versions for a given project. It's similar to the getVersionsByProject(ApplicationUser, Project)
but the results
it returns are paged.
The user making the request must have the ADMIN, PROJECT_ADMIN or BROWSE project permissions for the project. Otherwise, the errorCollection in the result object will contain an appropriate error message.
user | The user trying to get a version |
---|---|
project | The project object containing requested version |
pageRequest | details of a page to return (offset, max number of results) |
Move a version to have a lower sequence number - ie make it earlier.
moveVersionValidationResult | Move Version Validation Result |
---|
Is the passed version overdue? This method does no permission checks on the passed version.
version | the version to check. |
---|
Merges a version into another, then removes the original version.
context | The context for this service call. |
---|---|
result | The result of validation, which contains the version to be deleted, and the swap versions for Affects and Fix fields |
Move a version to the end of the version sequence.
moveVersionValidationResult | Move Version Validation Result |
---|
Move a version to the start of the version list.
moveVersionValidationResult | Move Version Validation Result |
---|
Using the validation result from #validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date) a version will be released. This method will throw an IllegalArgumentException if the provided data are invalid and version could not be released.
directoryUser | The user trying to release a version |
---|---|
currentVersion | The current version being released. |
newVersion | The version to move issues to. |
Move a version after another version.
moveVersionValidationResult | Move Version Validation Result |
---|
Creates a builder to be used when updating an existing Version
. The builder encapsulates all the fields
which need to be specified on update.
version | the Version object to update |
---|
Creates a builder to be used when creating a new Version
. The builder encapsulates all the fields which
need to be specified on create.
Using the validation result from #validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date) a version will be released. This method will throw an IllegalArgumentException if the provied data are invalid and version could not be released.
result | a ReleaseVersionValidationResult containg required data |
---|
Modify the release date of a version without performing a release/unrelease.
user | the user who is changing the release date |
---|---|
version | the version they want to modify |
releaseDate | the new release date to use |
Modify the release date of a version without performing a release/unrelease.
user | the user who is changing the release date |
---|---|
version | the version they want to modify |
releaseDate | the new release date to use |
Set the name and description of a version, if you have edit permission.
user | the user who is performing the edit operation |
---|---|
version | the version that they want to edit |
name | the new name for the version (must not be null or already in use) |
description | the new description for the version |
Takes a validation result and performs the unarchive operation.
result | The result from the validation |
---|
Using the validation result from #validateUnreleaseVersion(User, com.atlassian.jira.project.version.Version, Date) a version will be unreleased. This method will throw an IllegalArgumentException if the provied data are invalid and version could not be unreleased.
result | a ReleaseVersionValidationResult containg required data |
---|
Updates the existing Version
, based on the validation result from calling #validateUpdate(User,
VersionBuilder).
user | the user |
---|---|
validationResult | the result of validation |
This method should be called before archiving a version. It performs some basic validation of the version that was passed in. This includes a null check, checking that the version name isn't empty, and checking that the version is linked against a valid project.
The method also validates that the user passed in is either a global admin, or has project admin rights for the project that the version is linked to.
Finally, this method checks that the version that was passed in hasn't already been archived. If there's any errors, the validationResult will contain appropriate errors and wont be valid.
user | The user performing this operation |
---|---|
version | The version to be archived |
Validates the creation of a new Version
object, specified with a VersionBuilder
.
This replaces the deprecated methods: #validateCreateVersion(User, Project, String, Date, String, Long) and #validateCreateVersion(User, Project, String, String, String, Long).
user | the user who is performing the create |
---|---|
versionBuilder | the builder which specified the new Version to be created |
This method needs to be called before creating a version to ensure all parameters are correct. There are a number of required parameters, such as a project object and versionName. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version with the name provided already exists and throw an appropriate error.
Optional validation will be done for the release date, if provided. An error will be returned, if date format is valid.
The method will return a VersionService.CreateVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to create a version |
---|---|
project | The project object containing requested version |
versionName | The name of created version |
releaseDate | The release date for a version (optional) |
description | The description for a version (optional) |
scheduleAfterVersion | The version after which created version should be scheduled (optional) |
This method needs to be called before creating a version to ensure all parameters are correct. There are a number of required parameters, such as a project object and versionName. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version with the name provided already exists and throw an appropriate error.
Optional validation will be done for the release date, if provided. An error will be returned, if date format is valid.
The method will return a VersionService.CreateVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to create a version |
---|---|
project | The project object containing requested version |
versionName | The name of created version |
releaseDateStr | The release date for a version (optional) |
description | The description for a version (optional) |
scheduleAfterVersion | The version after which created version should be scheduled (optional) |
Validate Move a version to have a higher sequence number - ie make it later.
user | The user trying to move a version |
---|
Validates an attempt to delete a version from a project. When deleting a version, we need to decide what to do with issues that reference the version in their Affects of Fix Version fields. The action taken is specified as a flag for each field.
context | The context for this service call. |
---|---|
versionId | The id of the version to be deleted. |
affectsAction | Used to decide whether to move all the issues to a different 'affects' version or just
remove them. See REMOVE_ACTION , SWAP_ACTION |
fixAction | Used to decide wether to move all the issues to a different 'fix' version or just remove them.
See REMOVE_ACTION , SWAP_ACTION |
VersionService.ValidationResult
object which contains the version to delete, and the versions to swap to for
Affects and Fix versions, or null if the action to be taken is REMOVE_ACTION
Validate Move a version to have a lower sequence number - ie make it earlier.
user | The user trying to move a version |
---|
Implementation is the same as deleting, with the actions set to SWAP and the swapVersionId being passed as both Affects Version swap and Fix Version swap
context | The context for this service call. |
---|---|
versionId | The original version to be merged and removed. |
swapVersionId | The target version of the merge operation. Must be from the same project. |
VersionService.ValidationResult
object which contains the version to delete, and the versions to swap to for
Affects and Fix versions, or null if the action to be taken is REMOVE_ACTION
Validate Move a version to the end of the version sequence.
user | The user trying to move a version |
---|
Validate Move a version to the start of the version list.
user | The user trying to move a version |
---|
Validate Move a version after another version.
user | The user trying to move a version |
---|---|
versionId | version to reschedule |
scheduleAfterVersionId | id of the version to schedule after the given version object |
Validate the release date of a version without performing a release/unrelease.
user | the user who is changing the release date |
---|---|
version | the version they want to modify |
releaseDate | the new release date to use |
This method needs to be called before releasing a version to ensure all parameters are correct. There is required parameter, version object. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version provided has a valid name and if is not released already.
The method will return a VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to release a version |
---|---|
version | The version to release |
releaseDate | The version release date (optional) |
This method needs to be called before releasing a version to ensure all parameters are correct. There is required parameter, version object. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version provided has a valid name and if is not released already.
The method will return a VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to release a version |
---|---|
version | The version to release |
releaseDate | The version release date (optional) |
This method should be called before unarchiving a version. It performs some basic validation of the version that was passed in. This includes a null check, checking that the version name isn't empty, and checking that the version is linked against a valid project.
The method also validates that the user passed in is either a global admin, or has project admin rights for the project that the version is linked to.
Finally, this method checks that the version that was passed is currently archived. If there's any errors, the validationResult will contain appropriate errors and wont be valid.
user | The user performing this operation |
---|---|
version | The version to be archived |
This method needs to be called before unreleasing a version to ensure all parameters are correct. There is required parameter, version object. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version provided has a valid name and if is released already.
The method will return a VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to unrelease a version |
---|---|
version | The version to release |
releaseDate | The version release date (optional) |
This method needs to be called before unreleasing a version to ensure all parameters are correct. There is required parameter, version object. An error will be returned if the user making the request does not have the ADMIN or PROJECT_ADMIN permission for the project. The validation will also check if a version provided has a valid name and if is released already.
The method will return a VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user | The user trying to unrelease a version |
---|---|
version | The version to release |
releaseDate | The version release date (optional) |
Validates the update of an existing Version
object, specified with a VersionBuilder
.
This replaces the deprecated methods: #validateReleaseDate(User, Version, String) and #validateVersionDetails(User, Version, String, String).
user | the user who is performing the update |
---|---|
versionBuilder | the builder which specified the update to the existing Version |
Validate the name and description of a version, if you have edit permission.
user | the user who is performing the edit operation |
---|---|
version | the version that they want to edit |
name | the new name for the version (must not be null or already in use) |
description | the new description for the version |
Parses a string release date into a Date object, throwing an exception if there is a problem parsing the string. If the release date is an empty string, this method returns null.
user | the user who has provided the date |
---|---|
field | a DateField instance containing information what kind of date we are parsing |
date | a string containing a date |
DefaultVersionService.DateParseException | if there is a problem parsing the date string |
---|