Interface JiraBranchLinkingService
-
- All Known Implementing Classes:
JiraBranchLinkingServiceImpl
public interface JiraBranchLinkingService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull JiraIssueDetails
createRemoteLinkToBranch(@NotNull ImmutableChainBranch branch, @NotNull String issueKey)
Creates a remote link from the issue to the branch.@Nullable String
findIssueKeyToLink(@NotNull ImmutableChainBranch branch)
Looks for an issue key in plan branch name or vcs branch name.void
linkBranchToIssueIfRequiredAsync(@NotNull PlanKey planKey, @Nullable String username)
Looks for an issue key in the branch name.
-
-
-
Method Detail
-
linkBranchToIssueIfRequiredAsync
void linkBranchToIssueIfRequiredAsync(@NotNull @NotNull PlanKey planKey, @Nullable @Nullable String username)
Looks for an issue key in the branch name. If found will link the branch to the issue. And attempt to create a remote link from the issue to the branch. However this may fail. CheckChainBranchIdentifier.isRemoteJiraLinkRequired()
to see if remote link succeeded.- Parameters:
planKey
- of branch to linkusername
- (optional) to use for authentication if possible/required
-
createRemoteLinkToBranch
@NotNull @NotNull JiraIssueDetails createRemoteLinkToBranch(@NotNull @NotNull ImmutableChainBranch branch, @NotNull @NotNull String issueKey) throws RemoteLinkCreationFailedException, CredentialsRequiredContextException
Creates a remote link from the issue to the branch.- Parameters:
branch
- to linkissueKey
- of the issue to link- Throws:
RemoteLinkCreationFailedException
- if creation of the remote link in jira failsCredentialsRequiredContextException
- if authentication is required to create the remote link in JIRA.
-
findIssueKeyToLink
@Nullable @Nullable String findIssueKeyToLink(@NotNull @NotNull ImmutableChainBranch branch)
Looks for an issue key in plan branch name or vcs branch name. Will only return the first issue found. Only uses regex. No validation is performed for whether its a valid issue.- Parameters:
branch
- to find the issue for- Returns:
- issueKey if one exists.
-
-