public class BitbucketServerPullRequestHandler extends Object
Constructor and Description |
---|
BitbucketServerPullRequestHandler(com.atlassian.stash.rest.client.api.StashClient stashClient,
VcsRepositoryData vcsRepositoryData) |
Modifier and Type | Method and Description |
---|---|
com.atlassian.stash.rest.client.api.entity.PullRequestMergeability |
canMergePullRequest(long pullRequestId)
Retrieves given pull request mergeability state.
|
String |
getCreatePullRequestUrl(String branchName)
Retrieves pull request creation URL.
|
com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> |
getOpenPullRequests(String branchName,
long start,
long limit,
long avatarSize)
Retrieves open pull requests.
|
com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
mergePullRequest(long pullRequestId,
long version)
Merges given pull request.
|
public BitbucketServerPullRequestHandler(@NotNull com.atlassian.stash.rest.client.api.StashClient stashClient, @NotNull VcsRepositoryData vcsRepositoryData)
@NotNull public com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getOpenPullRequests(@Nullable String branchName, long start, long limit, long avatarSize)
Note (as of BBS 4.10-4.12 at least) this method will return only cached values of pull request merge outcome,
if no cached value is found the PullRequestStatus.getMergeOutcome()
will be empty. Consider using
canMergePullRequest(long)
to trigger actual checks when necessary.
trigger calculation of pull request mergeability state if no
current mergeability status is cached, what is not the case re
getOpenPullRequests(String, long, long, long)
.
branchName
- if empty, branch is taken from repository definitionstart
- index of the first result to retrieve (for paging)limit
- total number of results to retrieve after start (for Paging)avatarSize
- desired avatar size@Nullable public String getCreatePullRequestUrl(@Nullable String branchName)
branchName
- if empty, branch is taken from repository definition@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest(long pullRequestId, long version)
pullRequestId
- pull request id, assigned by BBSversion
- version version of pull request data user had seen when deciding to merge it. BBS would
reject merge attempt if data changed in the meantime, forcing user to refresh the view@NotNull public com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest(long pullRequestId)
Note (as of BBS 4.10-4.12 at least) this method will trigger calculation of pull request mergeability state if no
current mergeability status is cached, what is not the case re
getOpenPullRequests(String, long, long, long)
.
pullRequestId
- pull request id, assigned by BBSCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.