Interface JiraIssueHelper

  • All Known Implementing Classes:
    JiraIssueUtils

    public interface JiraIssueHelper
    A helper service for working with JIRA issues.
    • Method Detail

      • isValidIssueKey

        boolean isValidIssueKey​(@NotNull
                                @NotNull String string)
        Checks whether a given string could be a valid issue key.
      • findIssueKeysInText

        @NotNull
        @NotNull Set<String> findIssueKeysInText​(@NotNull
                                                 @NotNull String string)
        Find the JIRA issue keys within the given string.
        Parameters:
        string - text to search
        Returns:
        JIRA issue keys in order of appearance in the string
      • findIssueKeysInText

        @NotNull
        @NotNull Set<String> findIssueKeysInText​(@NotNull
                                                 @NotNull String string,
                                                 boolean ignoreIfInUrl)
        Find the JIRA issue keys within the given string.
        Parameters:
        string - text to search
        ignoreIfInUrl - whether to ignore found keys if they're part of URLs
        Returns:
        JIRA issue keys in order of appearance in the string
      • findPotentialIssueKeys

        @NotNull
        @NotNull LinkedHashSet<String> findPotentialIssueKeys​(@NotNull
                                                              @NotNull String string,
                                                              boolean ignoreIfInUrl,
                                                              Pattern issueKeyLeftBoundaryRegex,
                                                              Pattern issueKeyRightBoundaryRegex)
        Find the JIRA issue keys within the given string. Preserves the order they were found in.
      • findIssueKeysInTextAsList

        @NotNull
        @Deprecated
        @NotNull List<String> findIssueKeysInTextAsList​(@NotNull
                                                        @NotNull String string,
                                                        boolean ignoreIfInUrl)
        Deprecated.
        Find the JIRA issue keys within the given string. Maintains the order they were found in. Does not contain duplicates.
        Parameters:
        string - text to search
        ignoreIfInUrl - whether to ignore found keys if they're part of URLs
        Returns:
        A list of JIRA issue keys
      • findIssueKeysInTextAsList

        @NotNull
        @Deprecated
        @NotNull List<String> findIssueKeysInTextAsList​(@NotNull
                                                        @NotNull String string,
                                                        boolean ignoreIfInUrl,
                                                        @NotNull
                                                        @NotNull Pattern issueKeyBoundaryRegex)
        Deprecated.
        Find the JIRA issue keys within the given string. Maintains the order they were found in. Does not contain duplicates.

        This method accepts a Pattern as a parameter to test characters before and after discovered issue key, in order to adjust sensitivity of the search. As an example, for text "CR-BAM-1534", if the character "-" is disallowed by the boundary regex, the key "BAM-1534" will not be returned (as the "-" character is present in the text just before the key).

        Parameters:
        string - text to search
        ignoreIfInUrl - whether to ignore found keys if they're part of URLs
        issueKeyBoundaryRegex - regular expression which has to match characters before and after discovered issue key, for example "[^a-zA-Z0-9-]"
        Returns:
        A list of JIRA issue keys
      • isJiraServerSetup

        boolean isJiraServerSetup()
        Whether any JIRA server is linked with this instance of Bamboo.