Interface DeploymentVersionService
- All Known Implementing Classes:
DeploymentVersionServiceImpl
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Created for performance reasons. -
Method Summary
Modifier and TypeMethodDescription@NotNull DeploymentVersion
createDeploymentVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Deprecated.@NotNull DeploymentVersion
createDeploymentVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey, @Nullable com.atlassian.user.User user, @Nullable String versionName, @Nullable String nextVersionName) Create a deployment version with a specific name.@NotNull Map<DeploymentVersion,
Integer> findLatestKnownVersionsForEnvironmentsOfDeploymentProject
(DeploymentProject deploymentProject) Find allDeploymentVersion
that are currently deployed on environments of aDeploymentProject
For each version found give number of environments it is present on.findNextVersionContainingResult
(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Find the first version that is created from a result which is later than current result (not taking custom revision into account)@Nullable DeploymentVersion
findPreviousVersion
(long deploymentProjectId, long versionId) @NotNull Multimap<DeploymentProject,
Pair<Long, PlanResultKey>> findVersionIdentifiersAssociatedWithJiraIssue
(@NotNull String issueKey) Find all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProject
Note: this API is in its intermittent form and is subject to change.@NotNull List<DeploymentVersion>
findVersionsAssociatedWithJiraIssue
(long deploymentProjectId, @NotNull String issueKey) Find all the versions of aDeploymentProject
that are associated with a JIRA issue@NotNull Multimap<DeploymentProject,
DeploymentVersion> findVersionsAssociatedWithJiraIssue
(@NotNull String issueKey) Find all the version that are associated with a JIRA issue, grouped byDeploymentProject
@NotNull List<DeploymentVersion>
findVersionsBetween
(long deploymentProjectId, @NotNull DeploymentVersion version1, @NotNull DeploymentVersion version2) Deprecated.since 6.8 as it fetches variables, which is not efficient.@NotNull List<DeploymentVersion>
findVersionsBetweenNoVariables
(@org.jetbrains.annotations.NotNull long deploymentProjectId, @NotNull DeploymentVersion version1, @NotNull DeploymentVersion version2) Find versions created between version1 and version2.@NotNull List<DeploymentVersionStatus>
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
(long deploymentVersionId) @NotNull Map<Long,
List<DeploymentVersionStatus>> getAllUsersLatestVersionStatusesOrderedByCreationDate
(@NotNull List<Long> deploymentVersionIds) Find all users' latest version statuses for each version id ordered by creation date.@NotNull List<DeploymentVersion>
getDeploymentProjectVersions
(long deploymentProjectId) Deprecated.since 6.7 for performance reasons usegetDeploymentProjectVersionsNoVariables(DeploymentProject)
@NotNull List<DeploymentVersion>
getDeploymentProjectVersionsNoVariables
(@NotNull DeploymentProject deploymentProject) Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
getDeploymentProjectVersionsNoVariables
(@NotNull DeploymentProject deploymentProject, int offset, int maxResults) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).@NotNull List<DeploymentVersion>
getDeploymentProjectVersionsNoVariables
(@NotNull DeploymentProject deploymentProject, int offset, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).@Nullable DeploymentVersion
getDeploymentVersion
(long deploymentVersionId) Get DeploymentVersion by id@Nullable DeploymentVersion
getDeploymentVersionByName
(@NotNull String existingVersion, long deploymentProjectId) Get a specific version by name@NotNull String
getEvaluatedVersionName
(String nextVersionName, Map<String, VariableDefinitionContext> variables, Set<String> variablesToIncrement) @NotNull String
getIncrementedVersionName
(@NotNull String versionName) Calculates an increment of a version name.@Nullable DeploymentVersion
getLatestVersionForProject
(long deploymentProjectId) Deprecated.since 5.1 usegetLatestVersionForProject(long, PlanKey)
@Nullable DeploymentVersion
getLatestVersionForProject
(long deploymentProjectId, @NotNull PlanKey branchKey) Find the latest version for a deployment project.@Nullable DeploymentVersionStatus
getLatestVersionStatus
(long deploymentVersionId) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusDtosOrderedByCreationDate(long)
instead@NotNull Map<Long,
DeploymentVersionStatus> getLatestVersionStatuses
(@NotNull List<Long> deploymentVersionIds) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusesOrderedByCreationDate(List<Long>)
instead@NotNull DeploymentVersion
getOrCreateDeploymentVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Given a build result, find a deployment version that matches it, or create it if it doesn't exist.@NotNull Map<String,
VariableDefinitionContext> getPossibleVersionVariables
(@NotNull ImmutablePlan linkedPlan, boolean includeUndeterminable) Provides a map of variables which might show up on a version.@NotNull Map<String,
VariableDefinitionContext> getPossibleVersionVariables
(@NotNull ImmutablePlan linkedPlan, @Nullable PlanResultKey planResultKey, boolean includeUndeterminable) Provides a map of variables which might show up on a version.getRelatedPlanResultKeys
(long deploymentVersionId) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion@NotNull Map<Long,
PlanResultKey> getRelatedPlanResultKeys
(@NotNull Set<Long> deploymentVersionIds) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions@Nullable DeploymentVersion
getRelatedVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Find latest version of a deployment project that is related to specific plan result.getResultPlanKeysHavingDeploymentProjectVersions
(long deploymentProjectId) Returns keys of result plans (branch) that have at least one deployment project version (release)@NotNull List<VariableSubstitutionContext>
getVariableContextForVersion
(@org.jetbrains.annotations.NotNull long deploymentVersionId) Fetch variable context associated with a version.getVersionArtifacts
(@NotNull DeploymentVersion deploymentVersion) Find allArtifact
related to a version.getVersionNamePreview
(ResultsSummary resultsSummary, String versionName) Given a version name and a result summary, what would the version name look like after substitution.int
Count all versionsint
getVersionsCountForProject
(long deploymentProjectId) Count versions related to deployment projectint
getVersionsCountForProjectAndBranch
(long deploymentProjectId, @NotNull PlanKey branchKey) Count versions related to deployment project and a specified plan branchboolean
hasVersionsUnrelatedToBranch
(long deploymentProjectId, @NotNull PlanKey branchKey) Test if there areDeploymentVersion
s in aDeploymentProject
that are unrelated to given branchboolean
isFromTheSameBranch
(long firstVersionId, long secondVersionId) Checks if both deployment versions come from the same branchboolean
isFromTheSameBranch
(String planKey, long versionId) Checks if the specified build result is on the same branch as the specified version IDboolean
isVersionNameConflicting
(long deploymentProjectId, @NotNull String name) Check whether the version name is already being used by another version within this project@NotNull DeploymentVersion
renameVersion
(long deploymentProjectId, @NotNull DeploymentVersion deploymentVersion, @NotNull String newVersionName) Rename a version.void
resetVersionsAge
(@NotNull DeploymentVersion deploymentVersion) Resets version's age to 0.@NotNull List<DeploymentVersion>
searchVersionsByBranch
(long deploymentProjectId, @NotNull PlanKey branchKey) Deprecated.since 6.7 for performance reasons usesearchVersionsByBranchNoVariables(DeploymentProject, PlanKey)
@NotNull List<DeploymentVersion>
searchVersionsByBranchAndName
(long deploymentProjectId, @NotNull PlanKey branchKey, @NotNull String searchTerm) Deprecated.since 6.7 for performance reasons usesearchVersionsByNameNoVariables(DeploymentProject, String)
@NotNull List<DeploymentVersion>
searchVersionsByBranchAndNameNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByBranchAndNameNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, @NotNull String searchTerm, int offset, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByBranchNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByBranchNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, int startIndex, int maxResults) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByBranchNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, int startIndex, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByName
(long deploymentProjectId, @NotNull String searchTerm) Deprecated.since 6.7 for performance reasons usesearchVersionsByNameNoVariables(DeploymentProject, String)
@NotNull List<DeploymentVersion>
searchVersionsByNameNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>
searchVersionsByNameNoVariables
(@NotNull DeploymentProject deploymentProject, @NotNull String searchTerm, int offset, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)void
updatePlanKey
(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey) Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)void
updateVersionsForResult
(@NotNull PlanResultKey planResultKey) Update related versions data (artifacts and variables) after a chain stage has been completed.@NotNull DeploymentVersionStatus
updateVersionStatus
(long deploymentVersionId, @NotNull DeploymentVersionState status, @NotNull String userName) Updates the version status for given deployment version.@NotNull ErrorCollection
validateCreateDeploymentVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey, @Nullable String name, @Nullable String nextVersionName) Validates values to be used for creating a new version.@NotNull ErrorCollection
validateDeploymentVersionRename
(long deploymentProjectId, @NotNull DeploymentVersion deploymentVersion, @Nullable String name) Validates values to be used for renaming version.
-
Method Details
-
validateCreateDeploymentVersion
@NotNull @NotNull ErrorCollection validateCreateDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey, @Nullable @Nullable String name, @Nullable @Nullable String nextVersionName) Validates values to be used for creating a new version.- Parameters:
deploymentProjectId
- id of the deployment projectplanResultKey
- key of the build result on which this version is createdname
- version namenextVersionName
- name of the next version- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
isVersionNameConflicting
Check whether the version name is already being used by another version within this project- Parameters:
deploymentProjectId
- project to filter byname
- to check- Returns:
- true if name is already being used.
-
validateDeploymentVersionRename
@NotNull @NotNull ErrorCollection validateDeploymentVersionRename(long deploymentProjectId, @NotNull @NotNull DeploymentVersion deploymentVersion, @Nullable @Nullable String name) Validates values to be used for renaming version.- Parameters:
deploymentProjectId
-deploymentVersion
-name
-- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
createDeploymentVersion
@NotNull @Deprecated @NotNull DeploymentVersion createDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) throws WebValidationException Deprecated.since 5.6 usegetOrCreateDeploymentVersion(long, PlanResultKey)
Create a deployment version out of a deployment project and plan result. Automatic naming- Parameters:
deploymentProjectId
- of project to create version forplanResultKey
- of the result to pull artifacts from- Returns:
- created Deployment Version
- Throws:
WebValidationException
-
getOrCreateDeploymentVersion
@NotNull @NotNull DeploymentVersion getOrCreateDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) throws WebValidationException Given a build result, find a deployment version that matches it, or create it if it doesn't exist. Uses automatic naming.- Parameters:
deploymentProjectId
- of project to create version forplanResultKey
- of the result to pull artifacts from- Returns:
- deployment version
- Throws:
WebValidationException
- Since:
- 5.6
-
createDeploymentVersion
@NotNull @NotNull DeploymentVersion createDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey, @Nullable @Nullable com.atlassian.user.User user, @Nullable @Nullable String versionName, @Nullable @Nullable String nextVersionName) throws WebValidationException Create a deployment version with a specific name. From deployment project and plan result. Assumes validation of name has been done.- Parameters:
deploymentProjectId
- project the version is getting created forplanResultKey
- of the result to pull artifacts fromversionName
- name for the version to createnextVersionName
- the name for the next version (to be updated in version naming scheme)user
- the person who is creating this version- Returns:
- created Deployment Version.
- Throws:
WebValidationException
-
getDeploymentVersion
Get DeploymentVersion by id -
getResultPlanKeysHavingDeploymentProjectVersions
@NotNull @NotNull Set<String> getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId) Returns keys of result plans (branch) that have at least one deployment project version (release)- Parameters:
deploymentProjectId
- id of the deployment project- Returns:
-
getDeploymentProjectVersions
@NotNull @Deprecated @NotNull List<DeploymentVersion> getDeploymentProjectVersions(long deploymentProjectId) Deprecated.since 6.7 for performance reasons usegetDeploymentProjectVersionsNoVariables(DeploymentProject)
Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
getDeploymentProjectVersionsNoVariables(DeploymentProject)
should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Parameters:
deploymentProjectId
- id of the deployment project- Returns:
- all the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
-
searchVersionsByName
@NotNull @Deprecated @NotNull List<DeploymentVersion> searchVersionsByName(long deploymentProjectId, @NotNull @NotNull String searchTerm) Deprecated.since 6.7 for performance reasons usesearchVersionsByNameNoVariables(DeploymentProject, String)
Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
searchVersionsByNameNoVariables(DeploymentProject, String)
should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Parameters:
deploymentProjectId
- deployment project to search withinsearchTerm
- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranch
@NotNull @Deprecated @NotNull List<DeploymentVersion> searchVersionsByBranch(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Deprecated.since 6.7 for performance reasons usesearchVersionsByBranchNoVariables(DeploymentProject, PlanKey)
Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
searchVersionsByBranchNoVariables(DeploymentProject, PlanKey)
should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Parameters:
deploymentProjectId
- deployment project to search withinbranchKey
- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchAndName
@NotNull @Deprecated @NotNull List<DeploymentVersion> searchVersionsByBranchAndName(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm) Deprecated.since 6.7 for performance reasons usesearchVersionsByNameNoVariables(DeploymentProject, String)
Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
searchVersionsByBranchAndNameNoVariables(DeploymentProject, PlanKey, String)
should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Parameters:
deploymentProjectId
- deployment project to search withinbranchKey
- plan branch to narrow search resultsearchTerm
- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByNameNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinsearchTerm
- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 6.6
-
searchVersionsByNameNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull String searchTerm, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinsearchTerm
- term to look for.offset
- number of results to skipmaxResults
- maximum length of the returned listdeploymentVersionNeededAttributes
- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 10.0
-
searchVersionsByBranchNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinbranchKey
- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 6.6
-
searchVersionsByBranchNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, int startIndex, int maxResults) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinbranchKey
- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 7.0
-
searchVersionsByBranchNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, int startIndex, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinbranchKey
- plan branch to narrow search resultstartIndex
- number of results to skipmaxResults
- maximum length of the returned listdeploymentVersionNeededAttributes
- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 10.0
-
searchVersionsByBranchAndNameNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByBranchAndNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinbranchKey
- plan branch to narrow search resultsearchTerm
- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 6.6
-
searchVersionsByBranchAndNameNoVariables
@NotNull @NotNull List<DeploymentVersion> searchVersionsByBranchAndNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project to search withinbranchKey
- plan branch to narrow search resultsearchTerm
- term to look for.offset
- number of results to skipmaxResults
- maximum length of the returned listdeploymentVersionNeededAttributes
- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
- Since:
- 10.0
-
getDeploymentVersionByName
@Nullable @Nullable DeploymentVersion getDeploymentVersionByName(@NotNull @NotNull String existingVersion, long deploymentProjectId) Get a specific version by name- Parameters:
existingVersion
- name of the version- Returns:
- the Deployment version with given name if found, otherwise null.
-
getRelatedPlanResultKeys
Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion -
getRelatedPlanResultKeys
@NotNull @NotNull Map<Long,PlanResultKey> getRelatedPlanResultKeys(@NotNull @NotNull Set<Long> deploymentVersionIds) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions- Since:
- 9.3
-
isFromTheSameBranch
boolean isFromTheSameBranch(long firstVersionId, long secondVersionId) Checks if both deployment versions come from the same branch- Parameters:
firstVersionId
- first deployment versionsecondVersionId
- second deployment version- Returns:
-
isFromTheSameBranch
Checks if the specified build result is on the same branch as the specified version ID- Parameters:
planKey
- the planKey of the build result you want to compareversionId
- the version ID of the version you want to compare- Returns:
-
updateVersionStatus
@NotNull @NotNull DeploymentVersionStatus updateVersionStatus(long deploymentVersionId, @NotNull @NotNull DeploymentVersionState status, @NotNull @NotNull String userName) Updates the version status for given deployment version. -
getLatestVersionStatus
@Deprecated @Nullable @Nullable DeploymentVersionStatus getLatestVersionStatus(long deploymentVersionId) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusDtosOrderedByCreationDate(long)
instead -
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
@NotNull @NotNull List<DeploymentVersionStatus> getAllUsersLatestVersionStatusDtosOrderedByCreationDate(long deploymentVersionId) - Returns:
- all users' version statuses for the requested deploymentVersionId.
- Since:
- 9.4
-
findVersionsBetween
@Deprecated @NotNull @NotNull List<DeploymentVersion> findVersionsBetween(long deploymentProjectId, @NotNull @NotNull DeploymentVersion version1, @NotNull @NotNull DeploymentVersion version2) Deprecated.since 6.8 as it fetches variables, which is not efficient. UsefindVersionsBetweenNoVariables(long, DeploymentVersion, DeploymentVersion)
instead.Find versions created between version1 and version2. The versions must be different but belong to the sameDeploymentProject
The order of the argument is irrelevant: the method will determine which of the versions is the lower bound. Lower bound is not included in result but upper bound is. The result is sorted by creation date (newest first)- Throws:
IllegalArgumentException
- if any of the version doesn't exist
-
findVersionsBetweenNoVariables
@NotNull @NotNull List<DeploymentVersion> findVersionsBetweenNoVariables(@NotNull @org.jetbrains.annotations.NotNull long deploymentProjectId, @NotNull @NotNull DeploymentVersion version1, @NotNull @NotNull DeploymentVersion version2) Find versions created between version1 and version2. The versions must be different but belong to the sameDeploymentProject
The order of the argument is irrelevant: the method will determine which of the versions is the lower bound. Lower bound is not included in result but upper bound is. The result is sorted by creation date (newest first)- Throws:
IllegalArgumentException
- if any of the version doesn't exist
-
findPreviousVersion
-
getVersionsCount
int getVersionsCount()Count all versions- Returns:
- number of versions created in all deployment projects
-
getVersionsCountForProject
int getVersionsCountForProject(long deploymentProjectId) Count versions related to deployment project- Parameters:
deploymentProjectId
- id of deployment project- Returns:
- number of versions created in deployment project
-
getVersionsCountForProjectAndBranch
int getVersionsCountForProjectAndBranch(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Count versions related to deployment project and a specified plan branch- Parameters:
deploymentProjectId
- id of deployment projectbranchKey
- plan branch key- Returns:
- number of versions created in deployment project
- Since:
- 7.0
-
getDeploymentProjectVersionsNoVariables
@NotNull @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject) Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Parameters:
deploymentProject
- deployment project- Returns:
- all the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
-
getDeploymentProjectVersionsNoVariables
@NotNull @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, int offset, int maxResults) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).- Parameters:
deploymentProject
- deployment projectoffset
- number of results to skipmaxResults
- maximum length of the returned list- Returns:
- the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
-
getDeploymentProjectVersionsNoVariables
@NotNull @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).- Parameters:
deploymentProject
- deployment projectoffset
- number of results to skipmaxResults
- maximum length of the returned listdeploymentVersionNeededAttributes
- specify whether certain attributes will be loaded or not.- Returns:
- the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
- Since:
- 10.0
-
getLatestVersionForProject
@Deprecated @Nullable @Nullable DeploymentVersion getLatestVersionForProject(long deploymentProjectId) Deprecated.since 5.1 usegetLatestVersionForProject(long, PlanKey)
Find the latest version for a deployment project regardless of branch used to create it. Comparison based on creation date.- Parameters:
deploymentProjectId
- of the deployment project- Returns:
- the latest version for a deployment project
-
getLatestVersionForProject
@Nullable @Nullable DeploymentVersion getLatestVersionForProject(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Find the latest version for a deployment project. Comparison based on creation date.- Parameters:
deploymentProjectId
- of the deployment projectbranchKey
- key of the PlanBranch- Returns:
- the latest version created for a branch for a deployment project
-
getVersionArtifacts
@NotNull @NotNull Multimap<String,Artifact> getVersionArtifacts(@NotNull @NotNull DeploymentVersion deploymentVersion) Find allArtifact
related to a version.- Parameters:
deploymentVersion
-- Returns:
-
getRelatedVersion
@Nullable @Nullable DeploymentVersion getRelatedVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) Find latest version of a deployment project that is related to specific plan result.- Parameters:
deploymentProjectId
-planResultKey
-- Returns:
-
findNextVersionContainingResult
DeploymentVersion findNextVersionContainingResult(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) Find the first version that is created from a result which is later than current result (not taking custom revision into account)- Parameters:
deploymentProjectId
-planResultKey
-- Returns:
-
getPossibleVersionVariables
@NotNull @NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull @NotNull ImmutablePlan linkedPlan, boolean includeUndeterminable) Provides a map of variables which might show up on a version.- Parameters:
linkedPlan
- plan the deployment project is linked toincludeUndeterminable
- if true include variables that we don't currently know the value, with a nice example (used for display purposes)- Returns:
- a map of variables which might show up on a version.
-
getPossibleVersionVariables
@NotNull @NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull @NotNull ImmutablePlan linkedPlan, @Nullable @Nullable PlanResultKey planResultKey, boolean includeUndeterminable) Provides a map of variables which might show up on a version.- Parameters:
linkedPlan
- plan the deployment project is linked toplanResultKey
- resultKey for result variables contextincludeUndeterminable
- if true include variables that we don't currently know the value, with a nice example (used for display purposes)- Returns:
- a map of variables which might show up on a version.
-
getIncrementedVersionName
Calculates an increment of a version name. Increments last number in the name. If nothing found to increment will return passed in value.- Parameters:
versionName
- to increment- Returns:
- incremented version name.
-
getEvaluatedVersionName
@NotNull @NotNull String getEvaluatedVersionName(String nextVersionName, Map<String, VariableDefinitionContext> variables, Set<String> variablesToIncrement) - Parameters:
nextVersionName
-variables
-variablesToIncrement
-- Returns:
-
updatePlanKey
Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)- Parameters:
originalPlanKey
- original PlanKeynewPlanKey
- new PlanKey
-
renameVersion
@NotNull @NotNull DeploymentVersion renameVersion(long deploymentProjectId, @NotNull @NotNull DeploymentVersion deploymentVersion, @NotNull @NotNull String newVersionName) throws WebValidationException Rename a version.- Parameters:
deploymentProjectId
-deploymentVersion
-newVersionName
-- Returns:
- deploymentVersion with the name changed
- Throws:
WebValidationException
-
findVersionsAssociatedWithJiraIssue
@NotNull @NotNull List<DeploymentVersion> findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull @NotNull String issueKey) Find all the versions of aDeploymentProject
that are associated with a JIRA issue- Parameters:
deploymentProjectId
-issueKey
-- Since:
- 5.1
-
findVersionsAssociatedWithJiraIssue
@NotNull @NotNull Multimap<DeploymentProject,DeploymentVersion> findVersionsAssociatedWithJiraIssue(@NotNull @NotNull String issueKey) Find all the version that are associated with a JIRA issue, grouped byDeploymentProject
- Parameters:
issueKey
-- Since:
- 5.1
-
findVersionIdentifiersAssociatedWithJiraIssue
@Internal @NotNull @NotNull Multimap<DeploymentProject,Pair<Long, findVersionIdentifiersAssociatedWithJiraIssuePlanResultKey>> (@NotNull @NotNull String issueKey) Find all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProject
Note: this API is in its intermittent form and is subject to change.- Parameters:
issueKey
-- Since:
- 9.3
-
findLatestKnownVersionsForEnvironmentsOfDeploymentProject
@NotNull @NotNull Map<DeploymentVersion,Integer> findLatestKnownVersionsForEnvironmentsOfDeploymentProject(DeploymentProject deploymentProject) Find allDeploymentVersion
that are currently deployed on environments of aDeploymentProject
For each version found give number of environments it is present on.- Parameters:
deploymentProject
-- Returns:
- Since:
- 5.1
-
getVariableContextForVersion
@NotNull @NotNull List<VariableSubstitutionContext> getVariableContextForVersion(@NotNull @org.jetbrains.annotations.NotNull long deploymentVersionId) Fetch variable context associated with a version.- Since:
- 6.8.1
-
getVersionNamePreview
Given a version name and a result summary, what would the version name look like after substitution. Does not check/mutate for uniqueness.- Parameters:
resultsSummary
- the version would get created fromversionName
- the potential name of the version- Returns:
- substituted version name
-
resetVersionsAge
Resets version's age to 0.- Since:
- 5.7
-
getLatestVersionStatuses
@Deprecated @NotNull @NotNull Map<Long,DeploymentVersionStatus> getLatestVersionStatuses(@NotNull @NotNull List<Long> deploymentVersionIds) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusesOrderedByCreationDate(List<Long>)
insteadFind a latest version status for each version id. If no version status is available, the resulting map will not contain corresponding entry.- Parameters:
deploymentVersionIds
-- Since:
- 6.8
-
getAllUsersLatestVersionStatusesOrderedByCreationDate
@NotNull @NotNull Map<Long,List<DeploymentVersionStatus>> getAllUsersLatestVersionStatusesOrderedByCreationDate(@NotNull @NotNull List<Long> deploymentVersionIds) Find all users' latest version statuses for each version id ordered by creation date. If no version status is available, the resulting map will contain empty list.- Parameters:
deploymentVersionIds
-- Since:
- 9.4
-
updateVersionsForResult
Update related versions data (artifacts and variables) after a chain stage has been completed.
-
getOrCreateDeploymentVersion(long, PlanResultKey)