Interface VersionService
- All Known Implementing Classes:
DefaultVersionService
VersionService- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic classstatic classA generifiedServiceResultImplthat allows Service-specified Reasons to be set as part of the result (in addition to Reasons specified inside theErrorCollection.static classstatic interfaceRepresents the results of performing a validation call for a single merge or delete operation.static interfacestatic classResult object that relates to new VersionService methods that take aVersionBuilderas a parameter.static enumstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VersionService.VersionActionIndicates that theVersionshould be removed from affected issues. -
Method Summary
Modifier and TypeMethodDescriptionTakes a validation result and performs the archive operation.create(ApplicationUser user, VersionService.VersionBuilderValidationResult validationResult) Creates a newVersion, based on the validation result from calling.invalid reference
#validateCreate(User, VersionBuilder)Deprecated.createVersionDeletaAndReplaceParameters(Version versionToDelete) Create builder that for paramaters to remove version with swap (including custom fields)voiddecreaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to have a higher sequence number - ie make it later.deleteVersionAndSwap(JiraServiceContext serviceContext, DeleteVersionWithCustomFieldParameters parameters) Remove specified version.findVersions(ApplicationUser user, String substring) Returns all versions visible by the given user filtered by given query.findVersionsByProjects(ApplicationUser user, String substring, @NotEmpty Set<Long> projectIds) Returns all versions visible by the given user filtered by given query and available in given projects.longgetAffectsIssuesCount(Version version) Return the count of Issues that have the "Affects Version" field set to version.longgetCustomFieldIssuesCount(Version version) This method returns the total number of issues where this version is used in custom fieldsgetCustomFieldsUsing(Version version) This method returns usage information in custom fields for a given version.longgetFixIssuesCount(Version version) Return the count of Issues Fixed in this version.longgetUnresolvedIssuesCount(ApplicationUser user, Version version) Return the count of Issues that are unresolved in this version.getVersionById(ApplicationUser user, Project project, Long versionId) getVersionById(ApplicationUser user, Long versionId) Used to retrieve aVersionobject by version id.getVersionByProjectAndName(ApplicationUser user, Project project, String versionName) getVersionsByProject(ApplicationUser user, Project project) getVersionsByProject(ApplicationUser user, Project project, PageRequest pageRequest) This method returns all versions for a given project.getVersionsByProject(ApplicationUser user, Project project, PageRequest pageRequest, OrderByRequest<VersionService.VersionExtractableField> orderBy) This method returns all versions for a given project.voidincreaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to have a lower sequence number - ie make it earlier.booleanIs the passed version overdue? This method does no permission checks on the passed version.voidmerge(JiraServiceContext context, VersionService.ValidationResult result) Merges a version into another, then removes the original version.voidmoveToEndVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to the end of the version sequence.voidmoveToStartVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to the start of the version list.voidmoveUnreleasedToNewVersion(ApplicationUser user, Version currentVersion, Version newVersion) Using the validation result froma version will be released.invalid reference
#validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date)voidmoveVersionAfter(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version after another version.Creates a builder to be used when creating a newVersion.newVersionBuilder(Version version) Creates a builder to be used when updating an existingVersion.Using the validation result froma version will be released.invalid reference
#validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date)setReleaseDate(ApplicationUser user, Version version, String releaseDate) setReleaseDate(ApplicationUser user, Version version, Date releaseDate) setVersionDetails(ApplicationUser user, Version version, String name, String description) Takes a validation result and performs the unarchive operation.Using the validation result froma version will be unreleased.invalid reference
#validateUnreleaseVersion(User, com.atlassian.jira.project.version.Version, Date)update(ApplicationUser user, VersionService.VersionBuilderValidationResult validationResult) Updates the existingVersion, based on the validation result from calling.invalid reference
#validateUpdate(User, VersionBuilder)validateArchiveVersion(ApplicationUser user, Version version) This method should be called before archiving a version.validateCreate(ApplicationUser user, VersionBuilder versionBuilder) Validates the creation of a newVersionobject, specified with aVersionBuilder.validateCreateVersion(ApplicationUser user, Project project, String versionName, String releaseDate, String description, Long scheduleAfterVersion) validateCreateVersion(ApplicationUser user, Project project, String versionName, Date releaseDate, String description, Long scheduleAfterVersion) validateDecreaseVersionSequence(ApplicationUser user, long versionId) Validate Move a version to have a higher sequence number - ie make it later.validateDelete(JiraServiceContext context, Long versionId, VersionService.VersionAction affectsAction, VersionService.VersionAction fixAction) Deprecated.UsedeleteVersionAndSwap(JiraServiceContext, DeleteVersionWithCustomFieldParameters)that supports swapping version in custom fields.validateIncreaseVersionSequence(ApplicationUser user, long versionId) Validate Move a version to have a lower sequence number - ie make it earlier.validateMerge(JiraServiceContext context, Long versionId, Long swapVersionId) Validates an attempt to merge a version into another.validateMoveToEndVersionSequence(ApplicationUser user, long versionId) Validate Move a version to the end of the version sequence.validateMoveToStartVersionSequence(ApplicationUser user, long versionId) Validate Move a version to the start of the version list.validateMoveVersionAfter(ApplicationUser user, long versionId, Long scheduleAfterVersion) Validate Move a version after another version.validateReleaseVersion(ApplicationUser user, Version version, String releaseDate) This method needs to be called before releasing a version to ensure all parameters are correct.validateReleaseVersion(ApplicationUser user, Version version, Date releaseDate) This method needs to be called before releasing a version to ensure all parameters are correct.validateUnarchiveVersion(ApplicationUser user, Version version) This method should be called before unarchiving a version.validateUnreleaseVersion(ApplicationUser user, Version version, String releaseDate) This method needs to be called before unreleasing a version to ensure all parameters are correct.validateUnreleaseVersion(ApplicationUser user, Version version, Date releaseDate) This method needs to be called before unreleasing a version to ensure all parameters are correct.validateUpdate(ApplicationUser user, VersionBuilder versionBuilder) Validates the update of an existingVersionobject, specified with aVersionBuilder.
-
Field Details
-
REMOVE
Indicates that theVersionshould be removed from affected issues.
-
-
Method Details
-
setVersionDetails
@Deprecated ServiceOutcome<Version> setVersionDetails(ApplicationUser user, Version version, String name, String description) Deprecated.Set the name and description of a version, if you have edit permission.- Parameters:
user- the user who is performing the edit operationversion- the version that they want to editname- the new name for the version (must not be null or already in use)description- the new description for the version- Returns:
- a ServiceOutcome that contains the success or failure of the update
- Throws:
IllegalArgumentException- if the name is null or duplicates an existing name
-
setReleaseDate
@Deprecated ServiceOutcome<Version> setReleaseDate(ApplicationUser user, Version version, Date releaseDate) Deprecated.Modify the release date of a version without performing a release/unrelease.- Parameters:
user- the user who is changing the release dateversion- the version they want to modifyreleaseDate- the new release date to use- Returns:
- a ServiceOutcome describing the success/failure of the edit, along with the new Version if successful
-
setReleaseDate
@Deprecated ServiceOutcome<Version> setReleaseDate(ApplicationUser user, Version version, String releaseDate) Deprecated.Modify the release date of a version without performing a release/unrelease.- Parameters:
user- the user who is changing the release dateversion- the version they want to modifyreleaseDate- the new release date to use- Returns:
- a ServiceOutcome describing the success/failure of the edit, along with the new Version if successful
-
validateDelete
VersionService.ValidationResult validateDelete(JiraServiceContext context, Long versionId, VersionService.VersionAction affectsAction, VersionService.VersionAction fixAction) Deprecated.UsedeleteVersionAndSwap(JiraServiceContext, DeleteVersionWithCustomFieldParameters)that supports swapping version in custom fields. Since v7.0.10Validates 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.- Parameters:
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. SeeVersionKeys.REMOVE_ACTION,VersionKeys.SWAP_ACTIONfixAction- Used to decide wether to move all the issues to a different 'fix' version or just remove them. SeeVersionKeys.REMOVE_ACTION,VersionKeys.SWAP_ACTION- Returns:
- a
VersionService.ValidationResultobject 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 isVersionKeys.REMOVE_ACTION
-
validateMerge
VersionService.ValidationResult validateMerge(JiraServiceContext context, Long versionId, Long swapVersionId) Validates an attempt to merge a version into another. Merging is essentially the same as Deleting with the actions set toVersionKeys.SWAP_ACTION.- Parameters:
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.- Returns:
- a
VersionService.ValidationResultobject 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 isVersionKeys.REMOVE_ACTION
-
merge
Merges a version into another, then removes the original version.- Parameters:
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
-
getVersionById
Used to retrieve aVersionobject by version id within project specified byProjectobject. This method returns aVersionService.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.- Parameters:
user- The user trying to get a versionproject- The project object containing requested versionversionId- The id of requested version- Returns:
- VersionResult object
- Since:
- 6.1.1
-
getVersionById
Used to retrieve aVersionobject by version id. This method returns aVersionService.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.- Parameters:
user- The user trying to get a versionversionId- The id of requested version- Returns:
- VersionResult object
- Since:
- 6.1.1
-
getVersionByProjectAndName
@Nonnull VersionService.VersionResult getVersionByProjectAndName(@Nullable ApplicationUser user, @Nonnull Project project, @Nonnull String versionName) Used to retrieve aVersionobject by version name within project specified byProjectobject. This method returns aVersionService.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.- Parameters:
user- The user trying to get a versionproject- The project object containing requested versionversionName- The name of requested version- Returns:
- VersionResult containing errors and the Version if it could be found
- Since:
- v6.4
-
getVersionsByProject
@Nonnull VersionService.VersionsResult getVersionsByProject(@Nullable ApplicationUser user, @Nonnull Project project) Used to retrieve aVersioncollection within project specified byProjectobject. This method returns aVersionService.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.- Parameters:
user- The user trying to get a versionproject- The project object containing requested version- Returns:
- VerionsResult object
- Since:
- v6.4
-
getVersionsByProject
@Nonnull ServiceOutcome<Page<Version>> getVersionsByProject(@Nullable ApplicationUser user, @Nonnull Project project, @Nonnull PageRequest pageRequest) This method returns all versions for a given project. It's similar to thegetVersionsByProject(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.
- Parameters:
user- The user trying to get a versionproject- The project object containing requested versionpageRequest- details of a page to return (offset, max number of results)- Returns:
- A single page of versions or an appropriate error message if the user does not have permissions to read versions for the project
- Since:
- v6.4
- See Also:
-
getVersionsByProject
@Nonnull ServiceOutcome<Page<Version>> getVersionsByProject(@Nullable ApplicationUser user, @Nonnull Project project, @Nonnull PageRequest pageRequest, @Nullable OrderByRequest<VersionService.VersionExtractableField> orderBy) 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.VersionExtractableFieldclass.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.
- Parameters:
user- The user trying to get a versionproject- The project object containing requested versionpageRequest- details of a page to return (offset, max number of results)orderBy- details on how to order the results- Returns:
- A single page of versions or an appropriate error message if the user does not have permissions to read versions for the project
- Since:
- v6.4
- See Also:
-
findVersions
@Nonnull @ExperimentalApi Stream<Version> findVersions(@Nullable ApplicationUser user, @Nonnull String substring) Returns all versions visible by the given user filtered by given query.- Parameters:
user- user trying to find the versionssubstring- optional query used to filter returned versions- Since:
- v9.2
-
findVersionsByProjects
@Nonnull @ExperimentalApi Stream<Version> findVersionsByProjects(@Nullable ApplicationUser user, @Nonnull String substring, @NotEmpty @NotEmpty Set<Long> projectIds) Returns all versions visible by the given user filtered by given query and available in given projects.- Parameters:
user- user trying to find the versionssubstring- optional query used to filter returned versionsprojectIds- set of project IDs to filter versions with- Since:
- v9.2
-
validateCreateVersion
@Deprecated VersionService.CreateVersionValidationResult validateCreateVersion(ApplicationUser user, Project project, String versionName, String releaseDate, String description, Long scheduleAfterVersion) Deprecated.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.CreateVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to create a versionproject- The project object containing requested versionversionName- The name of created versionreleaseDate- 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)- Returns:
- CreateVersionValidationResult object
-
validateCreateVersion
@Deprecated VersionService.CreateVersionValidationResult validateCreateVersion(ApplicationUser user, Project project, String versionName, Date releaseDate, String description, Long scheduleAfterVersion) Deprecated.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.CreateVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to create a versionproject- The project object containing requested versionversionName- The name of created versionreleaseDate- 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)- Returns:
- CreateVersionValidationResult object
-
createVersion
@Deprecated Version createVersion(ApplicationUser user, VersionService.CreateVersionValidationResult request) Deprecated.Using the validation result froma new version will be created. This method will throw an RuntimeException if the version could not be created.invalid reference
#validateCreateVersion(User, com.atlassian.jira.project.Project, String, String, String, Long)- Parameters:
user- The user trying to get a versionrequest- TheVersionService.CreateVersionValidationResultobject containing all required data- Returns:
- created Version object
-
validateReleaseVersion
@Nonnull VersionService.ReleaseVersionValidationResult validateReleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nullable Date releaseDate) 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.ReleaseVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to release a versionversion- The version to releasereleaseDate- The version release date (optional)- Returns:
- ReleaseVersionValidationResult object
- Since:
- v6.4.
-
validateReleaseVersion
@Nonnull VersionService.ReleaseVersionValidationResult validateReleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nonnull String releaseDate) 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.ReleaseVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to release a versionversion- The version to releasereleaseDate- The version release date (optional)- Returns:
- ReleaseVersionValidationResult object
- Since:
- v6.4
-
validateUnreleaseVersion
@Nonnull VersionService.ReleaseVersionValidationResult validateUnreleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nullable Date releaseDate) 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.ReleaseVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to unrelease a versionversion- The version to releasereleaseDate- The version release date (optional)- Returns:
- ReleaseVersionValidationResult object
- Since:
- v6.4
-
validateUnreleaseVersion
@Nonnull VersionService.ReleaseVersionValidationResult validateUnreleaseVersion(@Nullable ApplicationUser user, @Nonnull Version version, @Nonnull String releaseDate) 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.ReleaseVersionValidationResultwhich contains an ErrorCollection with any potential errors and all the version's details.- Parameters:
user- The user trying to unrelease a versionversion- The version to releasereleaseDate- The version release date (optional)- Returns:
- ReleaseVersionValidationResult object
- Since:
- v6.4
-
releaseVersion
Using the validation result froma version will be released. This method will throw an IllegalArgumentException if the provied data are invalid and version could not be released.invalid reference
#validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date)- Parameters:
result- a ReleaseVersionValidationResult containg required data- Returns:
- a released version object
-
moveUnreleasedToNewVersion
void moveUnreleasedToNewVersion(@Nullable ApplicationUser user, @Nonnull Version currentVersion, @Nonnull Version newVersion) Using the validation result froma version will be released. This method will throw an IllegalArgumentException if the provided data are invalid and version could not be released.invalid reference
#validateReleaseVersion(User, com.atlassian.jira.project.version.Version, Date)- Parameters:
user- The user trying to release a versioncurrentVersion- The current version being released.newVersion- The version to move issues to.- Since:
- v6.4
-
unreleaseVersion
Using the validation result froma version will be unreleased. This method will throw an IllegalArgumentException if the provied data are invalid and version could not be unreleased.invalid reference
#validateUnreleaseVersion(User, com.atlassian.jira.project.version.Version, Date)- Parameters:
result- a ReleaseVersionValidationResult containg required data- Returns:
- a unreleased version object
-
validateArchiveVersion
@Nonnull VersionService.ArchiveVersionValidationResult validateArchiveVersion(@Nullable ApplicationUser user, @Nonnull Version version) 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.
- Parameters:
user- The user performing this operationversion- The version to be archived- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
validateUnarchiveVersion
@Nonnull VersionService.ArchiveVersionValidationResult validateUnarchiveVersion(@Nullable ApplicationUser user, @Nonnull Version version) 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.
- Parameters:
user- The user performing this operationversion- The version to be archived- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
archiveVersion
Takes a validation result and performs the archive operation.- Parameters:
result- The result from the validation- Returns:
- The version that was archived. Ideally this version should have been retrieved from the store for consistency
- Throws:
IllegalStateException- if the result passed in is not valid.
-
unarchiveVersion
Takes a validation result and performs the unarchive operation.- Parameters:
result- The result from the validation- Returns:
- The version that was unarchived. Ideally this version should have been retrieved from the store for consistency
- Throws:
IllegalStateException- if the result passed in is not valid.
-
isOverdue
Is the passed version overdue? This method does no permission checks on the passed version.- Parameters:
version- the version to check.- Returns:
- true if the passed version is overdue.
-
validateMoveToStartVersionSequence
@Nonnull VersionService.MoveVersionValidationResult validateMoveToStartVersionSequence(@Nullable ApplicationUser user, long versionId) Validate Move a version to the start of the version list.- Parameters:
user- The user trying to move a version- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
validateIncreaseVersionSequence
@Nonnull VersionService.MoveVersionValidationResult validateIncreaseVersionSequence(@Nullable ApplicationUser user, long versionId) Validate Move a version to have a lower sequence number - ie make it earlier.- Parameters:
user- The user trying to move a version- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
validateDecreaseVersionSequence
@Nonnull VersionService.MoveVersionValidationResult validateDecreaseVersionSequence(@Nullable ApplicationUser user, long versionId) Validate Move a version to have a higher sequence number - ie make it later.- Parameters:
user- The user trying to move a version- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
validateMoveToEndVersionSequence
@Nonnull VersionService.MoveVersionValidationResult validateMoveToEndVersionSequence(@Nullable ApplicationUser user, long versionId) Validate Move a version to the end of the version sequence.- Parameters:
user- The user trying to move a version- Returns:
- a validation result, containing any errors or the version details on success
- Since:
- v6.4
-
validateMoveVersionAfter
VersionService.MoveVersionValidationResult validateMoveVersionAfter(@Nullable ApplicationUser user, long versionId, @Nonnull Long scheduleAfterVersion) Validate Move a version after another version.- Parameters:
user- The user trying to move a versionversionId- version to reschedulescheduleAfterVersion- id of the version to schedule after the given version object- Returns:
- a validation result, containing any errors or the version details and schedule after target on success
- Since:
- v6.4
-
moveToStartVersionSequence
void moveToStartVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to the start of the version list.- Parameters:
moveVersionValidationResult- Move Version Validation Result
-
increaseVersionSequence
void increaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to have a lower sequence number - ie make it earlier.- Parameters:
moveVersionValidationResult- Move Version Validation Result
-
decreaseVersionSequence
void decreaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to have a higher sequence number - ie make it later.- Parameters:
moveVersionValidationResult- Move Version Validation Result
-
moveToEndVersionSequence
void moveToEndVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult) Move a version to the end of the version sequence.- Parameters:
moveVersionValidationResult- Move Version Validation Result
-
moveVersionAfter
Move a version after another version.- Parameters:
moveVersionValidationResult- Move Version Validation Result
-
getFixIssuesCount
Return the count of Issues Fixed in this version.- Returns:
- A count of issues
-
getAffectsIssuesCount
Return the count of Issues that have the "Affects Version" field set to version.- Returns:
- A count of issues
-
getCustomFieldsUsing
This method returns usage information in custom fields for a given version.- Parameters:
version- The version that we want to get information about.- Returns:
- collection of version usage for each custom fields.
-
getCustomFieldIssuesCount
This method returns the total number of issues where this version is used in custom fields- Parameters:
version- The version that we want to get information about.- Returns:
- collection of version usage for each custom fields.
- Since:
- 7.0.10
-
getUnresolvedIssuesCount
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.- Parameters:
user- the user trying to get the countversion- which version to check for unresolved issues- Returns:
- A count of issues
- Since:
- v6.4
-
createVersionDeletaAndReplaceParameters
DeleteVersionWithReplacementsParameterBuilder createVersionDeletaAndReplaceParameters(@Nonnull Version versionToDelete) Create builder that for paramaters to remove version with swap (including custom fields)- Parameters:
versionToDelete- version that will be deleted - mandatory- Since:
- 7.0.10
- See Also:
-
deleteVersionAndSwap
ServiceResult deleteVersionAndSwap(@Nonnull JiraServiceContext serviceContext, @Nonnull DeleteVersionWithCustomFieldParameters parameters) Remove specified version. According to information inDeleteVersionWithCustomFieldParametersversion will be completly removed from specific fields are replaced.- Parameters:
serviceContext- The context for this service call.parameters- parameters build with builder obtained bycreateVersionDeletaAndReplaceParameters(Version)- Returns:
- result than holds eventual errors in removal
- Since:
- 7.0.10
- See Also:
-
newVersionBuilder
VersionBuilder newVersionBuilder()Creates a builder to be used when creating a newVersion. The builder encapsulates all the fields which need to be specified on create.- Returns:
- the builder instance
- Since:
- v6.0
- See Also:
-
newVersionBuilder
Creates a builder to be used when updating an existingVersion. The builder encapsulates all the fields which need to be specified on update.- Parameters:
version- the Version object to update- Returns:
- the builder instance
- Since:
- v6.0
- See Also:
-
validateCreate
@Nonnull VersionService.VersionBuilderValidationResult validateCreate(@Nullable ApplicationUser user, @Nonnull VersionBuilder versionBuilder) Validates the creation of a newVersionobject, specified with aVersionBuilder.This replaces the deprecated methods:
andinvalid reference
#validateCreateVersion(User, Project, String, Date, String, Long).invalid reference
#validateCreateVersion(User, Project, String, String, String, Long)- Parameters:
user- the user who is performing the createversionBuilder- the builder which specified the new Version to be created- Returns:
- the result
- Since:
- v7.0
- See Also:
-
create
@Nonnull ServiceOutcome<Version> create(@Nullable ApplicationUser user, @Nonnull VersionService.VersionBuilderValidationResult validationResult) Creates a newVersion, based on the validation result from calling.invalid reference
#validateCreate(User, VersionBuilder)- Parameters:
user- the uservalidationResult- the result of validation- Returns:
- the new Version object; errors if not successful.
- Since:
- v6.4
- See Also:
-
validateUpdate
@Nonnull VersionService.VersionBuilderValidationResult validateUpdate(@Nullable ApplicationUser user, @Nonnull VersionBuilder versionBuilder) Validates the update of an existingVersionobject, specified with aVersionBuilder.- Parameters:
user- the user who is performing the updateversionBuilder- the builder which specified the update to the existing Version- Returns:
- the result
- Since:
- v6.4
- See Also:
-
update
ServiceOutcome<Version> update(ApplicationUser user, VersionService.VersionBuilderValidationResult validationResult) Updates the existingVersion, based on the validation result from calling.invalid reference
#validateUpdate(User, VersionBuilder)- Parameters:
user- the uservalidationResult- the result of validation- Returns:
- the updated Version object; errors if not successful.
- Since:
- v6.4
- See Also:
-
validateCreate(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)andcreate(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult).