Interface JiraIssueHelper
- All Known Implementing Classes:
JiraIssueUtils
public interface JiraIssueHelper
A helper service for working with JIRA issues.
-
Method Summary
Modifier and TypeMethodDescriptionfindIssueKeysInText
(@NotNull String string) Find the JIRA issue keys within the given string.findIssueKeysInText
(@NotNull String string, boolean ignoreIfInUrl) Find the JIRA issue keys within the given string.findIssueKeysInTextAsList
(@NotNull String string, boolean ignoreIfInUrl) Deprecated.findIssueKeysInTextAsList
(@NotNull String string, boolean ignoreIfInUrl, @NotNull Pattern issueKeyBoundaryRegex) Deprecated.since 6.5 usefindIssueKeysInText(String, boolean)
instead@NotNull LinkedHashSet<String>
findPotentialIssueKeys
(@NotNull String string, boolean ignoreIfInUrl, Pattern issueKeyLeftBoundaryRegex, Pattern issueKeyRightBoundaryRegex) Find the JIRA issue keys within the given string.boolean
Whether any JIRA server is linked with this instance of Bamboo.boolean
isValidIssueKey
(@NotNull String string) Checks whether a given string could be a valid issue key.
-
Method Details
-
isValidIssueKey
Checks whether a given string could be a valid issue key. -
findIssueKeysInText
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 searchignoreIfInUrl
- 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.since 6.5 usefindIssueKeysInText(String, boolean)
insteadFind the JIRA issue keys within the given string. Maintains the order they were found in. Does not contain duplicates.- Parameters:
string
- text to searchignoreIfInUrl
- 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.since 6.5 usefindIssueKeysInText(String, boolean)
insteadFind 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 searchignoreIfInUrl
- whether to ignore found keys if they're part of URLsissueKeyBoundaryRegex
- 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.
-
findIssueKeysInText(String, boolean)
instead