Package com.atlassian.jira.util
Class JiraKeyUtils
java.lang.Object
com.atlassian.jira.util.JiraKeyUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfastFormatIssueKey(String projectKey, Long issueNumber) static longgetCountFromKey(String key) Deprecated.static longDeprecated.UseIssueKey.from(String)instead.static StringDeprecated.UseIssueKey.from(String)instead.static StringgetIssueKeysFromString(String body) static StringDeprecated.UseIssueKey.from(String)instead.static booleanDetermines whether any JIRA issue key is in the given stringstatic booleanisKeyInString(String issueKey, String body) Determines whether the provided key is part of the provided stringstatic booleanisPartOfUrl(String body, int start) static booleanisReservedKeyword(String key) Check if the Project Key matches a list of reserved keywords - JRA-8051.static StringlinkBugKeys(String body) static voidResets the configuration of the key matcher so that it will re-read the ApplicationProperty that specifies how to find an issue key in a string.static StringslowFormatIssueKey(String projectKey, Long issueNumber) static booleanvalidIssueKey(String key) Validates the given issue key.static booleanvalidProjectKey(String key) Validates the given project key and returns true if valid, false otherwise.
-
Field Details
-
STRIKE_THROUGH_CLOSED_KEYS
- See Also:
-
-
Constructor Details
-
JiraKeyUtils
public JiraKeyUtils()
-
-
Method Details
-
resetKeyMatcher
public static void resetKeyMatcher()Resets the configuration of the key matcher so that it will re-read the ApplicationProperty that specifies how to find an issue key in a string. This must be called if the property for representing the key matching regular expression is changed at runtime. -
validProjectKey
Validates the given project key and returns true if valid, false otherwise.- Parameters:
key- project key to validate- Returns:
- True if the supplied project key is valid
-
isReservedKeyword
Check if the Project Key matches a list of reserved keywords - JRA-8051. For example, a folder named 'CON' cannot be created in WINDOWS as it is a reserved word.This check is only enabled for WINDOWS machines at present as this issue has only been reported in the WINDOWS environment.
- Parameters:
key- project key- Returns:
- true if reserved word, false otherwise
-
getProjectKeyFromIssueKey
Deprecated.UseIssueKey.from(String)instead. Since v6.1.Returns a project key of the project given issue belongs to.- Parameters:
key- issue key- Returns:
- The project key from an issue key, or null if the key is invalid
-
getFastProjectKeyFromIssueKey
Deprecated.UseIssueKey.from(String)instead. Since v6.1.Same asgetProjectKeyFromIssueKey(String)except that it does not check key validity- Parameters:
key- issue key- Returns:
- The project key from an issue key, or null if the key is invalid
-
getFastCountFromKey
Deprecated.UseIssueKey.from(String)instead. Since v6.1.Same asgetCountFromKey(String)except that is does not check for key validity- Parameters:
key- issue key- Returns:
- The issue count from an issue key, or -1 if the key is invalid
-
getCountFromKey
Deprecated.UseIssueKey.from(String)instead. Since v6.1.- Parameters:
key- issue key- Returns:
- The issue count from an issue key, or -1 if the key is invalid
-
validIssueKey
Validates the given issue key.- Parameters:
key- issue key- Returns:
- True if the supplied issue key starts with a valid project key, and ends with a number
-
isKeyInString
Determines whether the provided key is part of the provided string- Parameters:
issueKey- issue keybody- string to check- Returns:
- true if the given key is in the body, false otherwise
-
isKeyInString
Determines whether any JIRA issue key is in the given string- Parameters:
s- string to check- Returns:
- true if a key was found, false otherwise
-
linkBugKeys
-
getIssueKeysFromString
-
isPartOfUrl
-
getIssueKeyRegex
-
fastFormatIssueKey
-
slowFormatIssueKey
-
IssueKey.from(String)instead.