|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicApi public interface VersionService
Service for VersionService
Nested Class Summary | |
---|---|
static class |
VersionService.AbstractVersionResult
|
static class |
VersionService.ArchiveVersionValidationResult
|
static class |
VersionService.CreateVersionValidationResult
|
static class |
VersionService.MoveVersionValidationResult
|
static class |
VersionService.ReasonsServiceResult<R,T>
A generified ServiceResultImpl that allows Service-specified Reasons to be set as part of the result (in
addition to Reasons specified inside the ErrorCollection . |
static class |
VersionService.ReleaseVersionValidationResult
|
static interface |
VersionService.ValidationResult
Represents the results of performing a validation call for a single merge or delete operation. |
static interface |
VersionService.VersionAction
|
static class |
VersionService.VersionBuilder
A builder class to specify a new Version to create or an existing Version to update. |
static class |
VersionService.VersionBuilderValidationResult
Result object that relates to new VersionService methods that take a VersionService.VersionBuilder as a parameter. |
static class |
VersionService.VersionResult
|
static class |
VersionService.VersionsResult
|
Field Summary | |
---|---|
static VersionService.VersionAction |
REMOVE
Indicates that the Version should be removed from affected issues. |
Field Detail |
---|
static final VersionService.VersionAction REMOVE
Version
should be removed from affected issues.
Method Detail |
---|
ErrorCollection validateVersionDetails(com.atlassian.crowd.embedded.api.User user, Version version, String name, String description)
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and update(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
.
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
IllegalArgumentException
- if the name is null or duplicates an existing nameServiceOutcome<Version> setVersionDetails(com.atlassian.crowd.embedded.api.User user, Version version, String name, String description)
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and update(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
.
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
IllegalArgumentException
- if the name is null or duplicates an existing nameServiceOutcome<Version> setReleaseDate(com.atlassian.crowd.embedded.api.User user, Version version, Date releaseDate)
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and update(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
.
user
- the user who is changing the release dateversion
- the version they want to modifyreleaseDate
- the new release date to use
ServiceOutcome<Version> validateReleaseDate(com.atlassian.crowd.embedded.api.User user, Version version, String releaseDate)
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and update(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
.
user
- the user who is changing the release dateversion
- the version they want to modifyreleaseDate
- the new release date to use
ServiceOutcome<Version> setReleaseDate(com.atlassian.crowd.embedded.api.User user, Version version, String releaseDate)
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and update(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
.
user
- the user who is changing the release dateversion
- the version they want to modifyreleaseDate
- the new release date to use
VersionService.ValidationResult validateDelete(JiraServiceContext context, Long versionId, VersionService.VersionAction affectsAction, VersionService.VersionAction fixAction)
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 VersionKeys.REMOVE_ACTION
, VersionKeys.SWAP_ACTION
fixAction
- Used to decide wether to move all the issues to a different 'fix' version or just remove them.
See VersionKeys.REMOVE_ACTION
, VersionKeys.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 VersionKeys.REMOVE_ACTION
void delete(JiraServiceContext context, VersionService.ValidationResult result)
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 fieldsVersionService.ValidationResult validateMerge(JiraServiceContext context, Long versionId, Long swapVersionId)
VersionKeys.SWAP_ACTION
.
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 VersionKeys.REMOVE_ACTION
void merge(JiraServiceContext context, VersionService.ValidationResult result)
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 fieldsVersionService.VersionResult getVersionById(com.atlassian.crowd.embedded.api.User user, Project project, Long versionId)
getVersionById(ApplicationUser, Project, Long)
instead. Since v6.1.1.
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 versionproject
- The project object containing requested versionversionId
- The id of requested version
VersionService.VersionResult getVersionById(ApplicationUser user, Project project, Long versionId)
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 versionproject
- The project object containing requested versionversionId
- The id of requested version
VersionService.VersionResult getVersionById(com.atlassian.crowd.embedded.api.User user, Long versionId)
getVersionById(ApplicationUser, Long)
instead. Since v6.1.1.
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 versionversionId
- The id of requested version
VersionService.VersionResult getVersionById(ApplicationUser user, Long versionId)
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 versionversionId
- The id of requested version
VersionService.VersionResult getVersionByProjectAndName(com.atlassian.crowd.embedded.api.User user, Project project, String versionName)
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 versionproject
- The project object containing requested versionversionName
- The name of requested version
VersionService.VersionsResult getVersionsByProject(com.atlassian.crowd.embedded.api.User user, Project project)
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 versionproject
- The project object containing requested version
VersionService.CreateVersionValidationResult validateCreateVersion(com.atlassian.crowd.embedded.api.User user, Project project, String versionName, String releaseDate, String description, Long scheduleAfterVersion)
validateCreate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and create(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
VersionService.CreateVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
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)
VersionService.CreateVersionValidationResult validateCreateVersion(com.atlassian.crowd.embedded.api.User user, Project project, String versionName, Date releaseDate, String description, Long scheduleAfterVersion)
validateCreate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and create(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
VersionService.CreateVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
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)
Version createVersion(com.atlassian.crowd.embedded.api.User user, VersionService.CreateVersionValidationResult request)
validateCreate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
and create(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilderValidationResult)
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 versionrequest
- The VersionService.CreateVersionValidationResult
object
containg all required data
VersionService.ReleaseVersionValidationResult validateReleaseVersion(com.atlassian.crowd.embedded.api.User user, Version version, Date releaseDate)
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user
- The user trying to release a versionversion
- The version to releasereleaseDate
- The version release date (optional)
VersionService.ReleaseVersionValidationResult validateReleaseVersion(com.atlassian.crowd.embedded.api.User user, Version version, String releaseDate)
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user
- The user trying to release a versionversion
- The version to releasereleaseDate
- The version release date (optional)
VersionService.ReleaseVersionValidationResult validateUnreleaseVersion(com.atlassian.crowd.embedded.api.User user, Version version, Date releaseDate)
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user
- The user trying to unrelease a versionversion
- The version to releasereleaseDate
- The version release date (optional)
VersionService.ReleaseVersionValidationResult validateUnreleaseVersion(com.atlassian.crowd.embedded.api.User user, Version version, String releaseDate)
VersionService.ReleaseVersionValidationResult
which contains an ErrorCollection with any potential errors and all the version's details.
user
- The user trying to unrelease a versionversion
- The version to releasereleaseDate
- The version release date (optional)
Version releaseVersion(VersionService.ReleaseVersionValidationResult result)
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
void moveUnreleasedToNewVersion(com.atlassian.crowd.embedded.api.User user, Version currentVersion, Version newVersion)
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.
user
- The user trying to release a versioncurrentVersion
- The current version being released.newVersion
- The version to move issues to.Version unreleaseVersion(VersionService.ReleaseVersionValidationResult result)
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
VersionService.ArchiveVersionValidationResult validateArchiveVersion(com.atlassian.crowd.embedded.api.User user, Version version)
user
- The user performing this operationversion
- The version to be archived
VersionService.ArchiveVersionValidationResult validateUnarchiveVersion(com.atlassian.crowd.embedded.api.User user, Version version)
user
- The user performing this operationversion
- The version to be archived
Version archiveVersion(VersionService.ArchiveVersionValidationResult result)
result
- The result from the validation
IllegalStateException
- if the result passed in is not valid.Version unarchiveVersion(VersionService.ArchiveVersionValidationResult result)
result
- The result from the validation
IllegalStateException
- if the result passed in is not valid.boolean isOverdue(Version version)
version
- the version to check.
VersionService.MoveVersionValidationResult validateMoveToStartVersionSequence(com.atlassian.crowd.embedded.api.User user, long versionId)
user
- The user trying to move a versionversionId
-
VersionService.MoveVersionValidationResult validateIncreaseVersionSequence(com.atlassian.crowd.embedded.api.User user, long versionId)
user
- The user trying to move a versionversionId
-
VersionService.MoveVersionValidationResult validateDecreaseVersionSequence(com.atlassian.crowd.embedded.api.User user, long versionId)
user
- The user trying to move a versionversionId
-
VersionService.MoveVersionValidationResult validateMoveToEndVersionSequence(com.atlassian.crowd.embedded.api.User user, long versionId)
user
- The user trying to move a versionversionId
-
VersionService.MoveVersionValidationResult validateMoveVersionAfter(com.atlassian.crowd.embedded.api.User user, long versionId, Long scheduleAfterVersion)
user
- The user trying to move a versionversionId
- version to reschedulescheduleAfterVersion
- id of the version to schedule after the given version object
void moveToStartVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult)
moveVersionValidationResult
- Move Version Validation Resultvoid increaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult)
moveVersionValidationResult
- Move Version Validation Resultvoid decreaseVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult)
moveVersionValidationResult
- Move Version Validation Resultvoid moveToEndVersionSequence(VersionService.MoveVersionValidationResult moveVersionValidationResult)
moveVersionValidationResult
- Move Version Validation Resultvoid moveVersionAfter(VersionService.MoveVersionValidationResult moveVersionValidationResult)
moveVersionValidationResult
- Move Version Validation Resultlong getFixIssuesCount(Version version)
version
-
long getAffectsIssuesCount(Version version)
version
-
long getUnresolvedIssuesCount(com.atlassian.crowd.embedded.api.User user, Version version)
user
- the user trying to release the versionversion
- which version to check for unresolved issues
VersionService.VersionBuilder newBuilder()
Version
. The builder encapsulates all the fields
which need to be specified on create.
for updating an existing version
VersionService.VersionBuilder newBuilder(Version version)
Version
. The builder encapsulates all the fields
which need to be specified on update.
version
- the Version object to update
for creating a new version
VersionService.VersionBuilderValidationResult validateCreate(com.atlassian.crowd.embedded.api.User user, VersionService.VersionBuilder versionBuilder)
Version
object, specified with a VersionService.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 createversionBuilder
- the builder which specified the new Version to be created
newBuilder()
ServiceOutcome<Version> create(com.atlassian.crowd.embedded.api.User user, VersionService.VersionBuilderValidationResult validationResult)
Version
, based on the validation result from calling validateCreate(User, VersionBuilder)
.
user
- the uservalidationResult
- the result of validation
validateCreate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
VersionService.VersionBuilderValidationResult validateUpdate(com.atlassian.crowd.embedded.api.User user, VersionService.VersionBuilder versionBuilder)
Version
object, specified with a VersionService.VersionBuilder
.
This replaces the deprecated methods: validateReleaseDate(User, Version, String)
and validateVersionDetails(User, Version, String, String)
.
user
- the user who is performing the updateversionBuilder
- the builder which specified the update to the existing Version
newBuilder(com.atlassian.jira.project.version.Version)
ServiceOutcome<Version> update(com.atlassian.crowd.embedded.api.User user, VersionService.VersionBuilderValidationResult validationResult)
Version
, based on the validation result from calling validateUpdate(User, VersionBuilder)
.
user
- the uservalidationResult
- the result of validation
validateUpdate(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.version.VersionService.VersionBuilder)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |