Interface JiraBranchLinkingService

All Known Implementing Classes:
JiraBranchLinkingServiceImpl

public interface JiraBranchLinkingService
  • Method Details

    • 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. 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 @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 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 @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.