Class JiraBranchLinkingServiceImpl
java.lang.Object
com.atlassian.bamboo.jira.issuelink.JiraBranchLinkingServiceImpl
- All Implemented Interfaces:
JiraBranchLinkingService
-
Constructor Summary
ConstructorDescriptionJiraBranchLinkingServiceImpl
(PlanManager planManager, JiraRemoteIssueManager jiraRemoteIssueManager, JiraRestService jiraRestService, JiraApplinksService jiraApplinksService, JiraIssueUtils jiraIssueUtils, ImpersonationService impersonationService, ImmutablePlanCacheService immutablePlanCacheService) -
Method Summary
Modifier and TypeMethodDescription@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.
-
Constructor Details
-
JiraBranchLinkingServiceImpl
public JiraBranchLinkingServiceImpl(PlanManager planManager, JiraRemoteIssueManager jiraRemoteIssueManager, JiraRestService jiraRestService, JiraApplinksService jiraApplinksService, JiraIssueUtils jiraIssueUtils, ImpersonationService impersonationService, ImmutablePlanCacheService immutablePlanCacheService)
-
-
Method Details
-
linkBranchToIssueIfRequiredAsync
public void linkBranchToIssueIfRequiredAsync(@NotNull @NotNull PlanKey planKey, @Nullable @Nullable String username) Description copied from interface:JiraBranchLinkingService
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.- Specified by:
linkBranchToIssueIfRequiredAsync
in interfaceJiraBranchLinkingService
- Parameters:
planKey
- of branch to linkusername
- (optional) to use for authentication if possible/required
-
createRemoteLinkToBranch
@NotNull public @NotNull JiraIssueDetails createRemoteLinkToBranch(@NotNull @NotNull ImmutableChainBranch branch, @NotNull @NotNull String issueKey) throws RemoteLinkCreationFailedException, CredentialsRequiredContextException Description copied from interface:JiraBranchLinkingService
Creates a remote link from the issue to the branch.- Specified by:
createRemoteLinkToBranch
in interfaceJiraBranchLinkingService
- 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
Description copied from interface:JiraBranchLinkingService
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.- Specified by:
findIssueKeyToLink
in interfaceJiraBranchLinkingService
- Parameters:
branch
- to find the issue for- Returns:
- issueKey if one exists.
-