com.atlassian.bamboo.jira.issuelink
Interface JiraBranchLinkingService

All Known Implementing Classes:
JiraBranchLinkingServiceImpl

public interface JiraBranchLinkingService


Method Summary
 JiraIssueDetails createRemoteLinkToBranch(ImmutableChainBranch branch, java.lang.String issueKey)
          Creates a remote link from the issue to the branch.
 java.lang.String findIssueKeyToLink(ImmutableChainBranch branch)
          Looks for an issue key in plan branch name or vcs branch name.
 void linkBranchToIssueIfRequiredAsync(PlanKey planKey, java.lang.String username)
          Looks for an issue key in the branch name.
 

Method Detail

linkBranchToIssueIfRequiredAsync

void linkBranchToIssueIfRequiredAsync(@NotNull
                                      PlanKey planKey,
                                      @Nullable
                                      java.lang.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. Check ChainBranchIdentifier.isRemoteJiraLinkRequired() to see if remote link succeeded.

Parameters:
planKey - of branch to link
username - (optional) to use for authentication if possible/required

createRemoteLinkToBranch

@NotNull
JiraIssueDetails createRemoteLinkToBranch(@NotNull
                                                  ImmutableChainBranch branch,
                                                  @NotNull
                                                  java.lang.String issueKey)
                                          throws RemoteLinkCreationFailedException,
                                                 CredentialsRequiredContextException
Creates a remote link from the issue to the branch.

Parameters:
branch - to link
issueKey - of the issue to link
Throws:
RemoteLinkCreationFailedException - if creation of the remote link in jira fails
CredentialsRequiredContextException - if authentication is required to create the remote link in JIRA.

findIssueKeyToLink

@Nullable
java.lang.String findIssueKeyToLink(@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.


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.