@PublicApi
public interface VersionManager
Modifier and Type | Field and Description |
---|---|
static String |
ALL_RELEASED_VERSIONS
Used to retrieve all released versions
|
static String |
ALL_UNRELEASED_VERSIONS
Used to retrieve all unreleased versions
|
static String |
NO_VERSIONS
Used to represent empty version fields
|
Modifier and Type | Method and Description |
---|---|
Version |
archiveVersion(Version version,
boolean archive)
Archive/Un-archive a single version depending on the archive flag.
|
void |
archiveVersions(String[] idsToArchive,
String[] idsToUnarchive)
Method used to archive and un-archive a number of versions.
|
Version |
createVersion(String name,
Date startDate,
Date releaseDate,
String description,
Long projectId,
Long scheduleAfterVersion)
Deprecated.
Since JIRA version 7.0.1, this is deprecated on favour of
createVersion(String, java.util.Date, java.util.Date, String, Long, Long, boolean)
which lets you specify the release attribute value for the new
Version object. |
Version |
createVersion(String name,
Date startDate,
Date releaseDate,
String description,
Long projectId,
Long scheduleAfterVersion,
boolean released)
Creates a new
Version . |
Version |
createVersion(String name,
Date releaseDate,
String description,
Long projectId,
Long scheduleAfterVersion)
Deprecated.
Since JIRA version 7.0.1, this is deprecated on favour of
createVersion(String, java.util.Date, java.util.Date, String, Long, Long, boolean)
which lets you specify the startDate and release attribute values
for the new Version object. |
Version |
decreaseVersionSequence(Version version)
Move a version to have a higher sequence number - ie make it later
|
void |
deleteAllVersions(Long projectId)
Deletes all versions in given project.
|
void |
deleteAndRemoveFromIssues(ApplicationUser user,
Version versionToRemove)
This method deletes a version and additionally (unlinke
deleteVersion(com.atlassian.jira.project.version.Version) ) removes it from all issues that reference it. |
void |
deleteVersion(ApplicationUser applicationUser,
Version versionToDelete,
com.atlassian.fugue.Option<Version> affectsSwapVersion,
com.atlassian.fugue.Option<Version> fixSwapVersion)
Deprecated.
Use
deleteVersionAndSwap(ApplicationUser, DeleteVersionWithCustomFieldParameters) that
supports swapping version in custom fields.
Since v7.0.10 |
void |
deleteVersion(Version version)
Removes a specific version from the system.
|
void |
deleteVersionAndSwap(ApplicationUser applicationUser,
DeleteVersionWithCustomFieldParameters parameters)
Remove specified version.
|
Version |
editVersionDetails(Version version,
String name,
String description)
Updates details of an existing version.
|
Version |
editVersionReleaseDate(Version version,
Date duedate)
Update the release date of a version.
|
Version |
editVersionStartDate(Version version,
Date startDate)
Updates the start date of a version
|
Version |
editVersionStartReleaseDate(Version version,
Date startDate,
Date releaseDate)
Updates the start and release date of a version
|
Collection<Version> |
getAffectedVersionsFor(Issue issue)
Get all affected versions of the specified issue.
|
Collection<Version> |
getAllVersions() |
Collection<Version> |
getAllVersionsForProjects(Collection<Project> projects,
boolean includeArchived)
Returns all versions that belong to the passed projects.
|
Collection<Version> |
getAllVersionsReleased(boolean includeArchived) |
Collection<Version> |
getAllVersionsUnreleased(boolean includeArchived) |
long |
getCustomFieldIssuesCount(Version version)
This method gives total number of issues where this version is used in custom fields.
|
Collection<CustomFieldWithVersionUsage> |
getCustomFieldsUsing(Version version)
This method gives information about usage of given version in custom fields.
|
Collection<Version> |
getFixVersionsFor(Issue issue)
Get all fix for versions of the specified issue.
|
Collection<Long> |
getIssueIdsWithAffectsVersion(Version version)
Return all the issues in which the affects version matches the specified version.
|
Collection<Long> |
getIssueIdsWithFixVersion(Version version)
Return all the issues in which the fix version matches the specified version.
|
Collection<Issue> |
getIssuesWithAffectsVersion(Version version)
Return all the issues in which the affected version matches the specified version.
|
Collection<Issue> |
getIssuesWithFixVersion(Version version)
Return all the issues in which the fix for version matches the specified version.
|
Collection<Version> |
getOtherUnarchivedVersions(Version version)
Return all unarchived versions except this one
|
Collection<Version> |
getOtherVersions(Version version)
Return all other versions in the project except this one
|
Version |
getVersion(Long id)
Returns a single version.
|
Version |
getVersion(Long projectId,
String versionName)
Search for a version by projectID and name.
|
Collection<Version> |
getVersions(List<Long> ids)
Return a collection of
Version s matching the ids passed in. |
List<Version> |
getVersions(Long projectId)
Return a list of Versions for the given project.
|
List<Version> |
getVersions(Long projectId,
boolean includeArchived)
Return a list of Versions for the given project.
|
List<Version> |
getVersions(Project project)
Return a list of Versions for the given project.
|
Collection<Version> |
getVersionsArchived(Project project)
Return all archived versions for a particular project.
|
Collection<Version> |
getVersionsByName(String versionName)
Return a collection of
Version s that have the specified name. |
Collection<Version> |
getVersionsReleased(Long projectId,
boolean includeArchived)
Gets a list of released versions for a project.
|
Collection<Version> |
getVersionsReleasedDesc(Long projectId,
boolean includeArchived)
Gets a list of released versions for a project in reverse order.
|
Collection<Version> |
getVersionsUnarchived(Long projectId)
Return all un-archived versions for a particular project
|
Collection<Version> |
getVersionsUnreleased(Long projectId,
boolean includeArchived)
Gets a list of un-released versions for a particular project.
|
Version |
increaseVersionSequence(Version version)
Move a version to have a lower sequence number - ie make it earlier
|
boolean |
isDuplicateName(Version version,
String name)
Check that the version name we are changing to is not a duplicate.
|
boolean |
isVersionOverDue(Version version)
Checks to see if a version is overdue.
|
void |
merge(ApplicationUser user,
Version versionToDelete,
Version versionToMergeTo)
This method will perform a version merge.
|
void |
moveIssuesToNewVersion(List<Issue> issues,
Version currentVersion,
Version swapToVersion)
Swaps the list of issues supplied from one Fix version to another.
|
Version |
moveToEndVersionSequence(Version version)
Move a version to the end of the version sequence
|
Version |
moveToStartVersionSequence(Version version)
Move a version to the start of the version list
|
Version |
moveVersionAfter(Version version,
Long scheduleAfterVersion)
Move a version after another version
|
Version |
releaseVersion(Version version,
boolean release)
Used to release or unrelease a version, depending on the release flag.
|
Collection<Version> |
releaseVersions(Collection<Version> versions,
boolean release)
Used to release versions depending on the release flag.
|
void |
swapVersionForRelatedIssues(ApplicationUser user,
Version version,
com.atlassian.fugue.Option<Version> affectsSwapVersion,
com.atlassian.fugue.Option<Version> fixSwapVersion)
This method will update all issues that currently have
version set as either affects or fix version to
the new affectsSwapVersion or fixSwapVersion |
Version |
update(Version version)
Persists updates to the specified version object.
|
List<ChangeItemBean> |
updateIssueAffectsVersions(Issue issue,
Collection<Version> newValue) |
List<ChangeItemBean> |
updateIssueFixVersions(Issue issue,
Collection<Version> newValue) |
static final String NO_VERSIONS
static final String ALL_UNRELEASED_VERSIONS
static final String ALL_RELEASED_VERSIONS
Version createVersion(String name, Date releaseDate, String description, Long projectId, Long scheduleAfterVersion) throws CreateException
createVersion(String, java.util.Date, java.util.Date, String, Long, Long, boolean)
which lets you specify the startDate
and release
attribute values
for the new Version
object.Version
object.name
- the NamereleaseDate
- date of release or null if not released.description
- the DescriptionprojectId
- the id of the Project of the version.scheduleAfterVersion
- id of the version after which this should be sequenced or null.CreateException
- If there was a problem creating the version.@Deprecated Version createVersion(String name, Date startDate, Date releaseDate, String description, Long projectId, Long scheduleAfterVersion) throws CreateException
createVersion(String, java.util.Date, java.util.Date, String, Long, Long, boolean)
which lets you specify the release
attribute value for the new
Version
object.Version
object.name
- the NamestartDate
- start date of the version or nullreleaseDate
- date of release or null if not released.description
- the DescriptionprojectId
- the id of the Project of the version.scheduleAfterVersion
- id of the version after which this should be sequenced or null.CreateException
- If there was a problem creating the version.Version createVersion(String name, Date startDate, Date releaseDate, String description, Long projectId, Long scheduleAfterVersion, boolean released) throws CreateException
Version
.
This method differs from createVersion(String, java.util.Date, java.util.Date, String, Long, Long)
in
that it lets you specify the value for the attribute release
.name
- Name of the versionstartDate
- Start date of the versionreleaseDate
- Release date for the versiondescription
- Version descriptionprojectId
- The numeric id of the project this version belongsscheduleAfterVersion
- Numeric id of the version to schedule after the given version objectreleased
- Sets the release
attribute value for the version object to createCreateException
Version moveToStartVersionSequence(Version version)
version
- the Version to moveVersion increaseVersionSequence(Version version)
version
- the VersionVersion decreaseVersionSequence(Version version)
version
- the VersionVersion moveToEndVersionSequence(Version version)
version
- the VersionVersion moveVersionAfter(Version version, Long scheduleAfterVersion)
version
- version to reschedulescheduleAfterVersion
- id of the version to schedule after the given version objectvoid deleteVersion(Version version)
version
- The version to be removed.deleteAndRemoveFromIssues(com.atlassian.jira.user.ApplicationUser, Version)
void deleteVersion(ApplicationUser applicationUser, Version versionToDelete, com.atlassian.fugue.Option<Version> affectsSwapVersion, com.atlassian.fugue.Option<Version> fixSwapVersion)
deleteVersionAndSwap(ApplicationUser, DeleteVersionWithCustomFieldParameters)
that
supports swapping version in custom fields.
Since v7.0.10versionToDelete
is the version which is going to be removed.
If affectsSwapVersion
is defined, then issues with versionToDelete
as a value of Affects Version/s
system field will use affectsSwapVersion
instead.
Similarly, fixSwapVersion
will replace versionToDelete
as a value in Fix Version/s system field.applicationUser
- the user that will be used to update related issuesversionToDelete
- the version to be deletedaffectsSwapVersion
- the version which replaces the version to be deleted as Affected Version/s.fixSwapVersion
- the version which replaces the version to be deleted as Fix Version/s.void deleteAllVersions(@Nonnull Long projectId)
projectId
- the id of project in which versions will be deleted.Version editVersionDetails(Version version, String name, String description)
version
- The version to updatename
- The new version name, cannot be empty.description
- The description of this version.IllegalArgumentException
- If the name is not set, or already exists.boolean isDuplicateName(Version version, String name)
version
- The version to updatename
- The new name for the versionVersion releaseVersion(Version version, boolean release)
version
- Version to be released (or unreleased)release
- True to release a version. False to 'unrelease' a versionCollection<Version> releaseVersions(Collection<Version> versions, boolean release)
versions
- Collection of Version
srelease
- True to release a version. False to 'unrelease' a versionvoid moveIssuesToNewVersion(List<Issue> issues, Version currentVersion, Version swapToVersion) throws IndexException
issues
- the IssuescurrentVersion
- Current fix version they will be swapped fromswapToVersion
- New fix version they will be swapped to.IndexException
- if an error occurs will indexing these new issue values.void archiveVersions(String[] idsToArchive, String[] idsToUnarchive)
idsToArchive
- Archive all these VersionsidsToUnarchive
- Unarchive these VersionsVersion archiveVersion(Version version, boolean archive)
version
- the Version to archive or unarchivearchive
- new archive valueCollection<Version> getVersionsUnarchived(Long projectId)
projectId
- id of the project.Version
sCollection<Version> getVersionsArchived(Project project)
project
- the ProjectVersion update(Version version)
version
- the versionVersion editVersionReleaseDate(Version version, Date duedate)
version
- the Version to editduedate
- new release dateVersion editVersionStartDate(Version version, Date startDate)
version
- the version to editstartDate
- new start dateVersion editVersionStartReleaseDate(Version version, Date startDate, Date releaseDate)
version
- the version to editstartDate
- new start datereleaseDate
- new release dateboolean isVersionOverDue(Version version)
version
- the VersionList<Version> getVersions(Long projectId)
projectId
- the ProjectgetVersions(Project)
List<Version> getVersions(Long projectId, boolean includeArchived)
projectId
- the ProjectincludeArchived
- whether or not to include archived versionsgetVersions(Project)
List<Version> getVersions(Project project)
project
- the ProjectgetVersions(Long)
Collection<Version> getVersionsByName(String versionName)
Version
s that have the specified name.versionName
- the name of the version (case-insensitive)Collection<Version> getVersions(List<Long> ids)
Version
s matching the ids passed in.ids
- Version IDsVersion
s matching the ids passed in.Version getVersion(Long id)
id
- the Version IDVersion
object.Version getVersion(Long projectId, String versionName)
projectId
- the ProjectversionName
- the Version nameVersion
object.Collection<Version> getVersionsUnreleased(Long projectId, boolean includeArchived)
projectId
- The id of the project for which to return versionsincludeArchived
- True if archived versions should be includedVersion
s, never nullCollection<Version> getVersionsReleased(Long projectId, boolean includeArchived)
projectId
- project idincludeArchived
- flag to indicate whether to include archived versions in the result.Version
objectsCollection<Version> getVersionsReleasedDesc(Long projectId, boolean includeArchived)
projectId
- project idincludeArchived
- flag to indicate whether to include archived versions in the result.Version
objectsCollection<Version> getOtherVersions(Version version)
version
- the VersionCollection<Version> getOtherUnarchivedVersions(Version version)
version
- the VersionCollection<Issue> getIssuesWithFixVersion(Version version)
version
- the fixed for version.Collection<Issue> getIssuesWithAffectsVersion(Version version)
version
- the affected version.Collection<Long> getIssueIdsWithAffectsVersion(@Nonnull Version version)
version
- the affects version.Collection<Long> getIssueIdsWithFixVersion(@Nonnull Version version)
version
- the fix version.Collection<Version> getAffectedVersionsFor(Issue issue)
issue
- the issueList<ChangeItemBean> updateIssueAffectsVersions(Issue issue, Collection<Version> newValue)
List<ChangeItemBean> updateIssueFixVersions(Issue issue, Collection<Version> newValue)
Collection<Version> getFixVersionsFor(Issue issue)
issue
- the IssueCollection<Version> getAllVersions()
Collection<Version> getAllVersionsForProjects(Collection<Project> projects, boolean includeArchived)
projects
- projects to search inincludeArchived
- whether or not to include archived versionsCollection<Version> getAllVersionsReleased(boolean includeArchived)
includeArchived
- whether or not to include archived versionsCollection<Version> getAllVersionsUnreleased(boolean includeArchived)
includeArchived
- whether or not to include archived versionsvoid swapVersionForRelatedIssues(ApplicationUser user, Version version, com.atlassian.fugue.Option<Version> affectsSwapVersion, com.atlassian.fugue.Option<Version> fixSwapVersion)
version
set as either affects or fix version to
the new affectsSwapVersion
or fixSwapVersion
Both affectsSwapVersion
or fixSwapVersion
may be undefined in which case the version
will
simply be removed from the issue.
user
- The user that will be used to update related issuesversion
- The version to remove from issuesaffectsSwapVersion
- Affects version to replace version with. May be undefined to simply remove the
version.fixSwapVersion
- Fix version to replace version with. May be undefined to simply remove the version.merge(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.project.version.Version, com.atlassian.jira.project.version.Version)
,
deleteAndRemoveFromIssues(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.project.version.Version)
void merge(ApplicationUser user, @Nonnull Version versionToDelete, @Nonnull Version versionToMergeTo)
versionToDelete
is a version that will be deleted completely.
All issues will have this version replaced with versionToMergeTo
.user
- The user that will be used to update related issuesversionToDelete
- Version that will be deletedversionToMergeTo
- All issues will have deleted version replaced with this onevoid deleteAndRemoveFromIssues(ApplicationUser user, @Nonnull Version versionToRemove)
deleteVersion(com.atlassian.jira.project.version.Version)
) removes it from all issues that reference it.user
- User that will perform the update of issues.versionToRemove
- Version to be deleted.@Nonnull Collection<CustomFieldWithVersionUsage> getCustomFieldsUsing(@Nonnull Version version)
version
- The version that we want to get information about.long getCustomFieldIssuesCount(@Nonnull Version version)
version
- The version that we want to get information about.void deleteVersionAndSwap(ApplicationUser applicationUser, DeleteVersionWithCustomFieldParameters parameters)
DeleteVersionWithCustomFieldParameters
version will be completly removed from specific fields are replaced.applicationUser
- The user for this callparameters
- parameters build with builder obtained by
VersionService.createVersionDeletaAndReplaceParameters(Version)
merge - if you want to replace all version references to given
version.
Copyright © 2002-2017 Atlassian. All Rights Reserved.