public class JiraIssueUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JiraIssueUtils.JiraPanel |
Modifier and Type | Field and Description |
---|---|
static String |
PROJECT_ISSUE_NUMBER_SEPARATOR |
static String |
RENDERED_JIRA_KEY |
static String |
RENDERED_JIRA_KEY_NO_SERVER |
Constructor and Description |
---|
JiraIssueUtils(JiraApplinksService jiraApplinksService,
ResultsSummaryManager resultsSummaryManager,
com.atlassian.event.api.EventPublisher eventPublisher,
AdministrationConfigurationAccessor administrationConfigurationAccessor) |
Modifier and Type | Method and Description |
---|---|
static com.google.common.base.Function<JiraXmlSearchResultItemEntity,JiraIssueDetails> |
buildJiraIssueDetailsFromSearchResultFunction(com.atlassian.applinks.api.ApplicationLink applicationLink,
JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
Returns function which builds
JiraIssueDetails from JIRA XML search result |
void |
findAndSaveJiraIssueKeys(String string,
ResultsSummary buildResultsSummary)
Finds any jira issue keys in the given input string, and saves them against the given build result summary.
|
LinkedHashSet<String> |
findIssueKeys(String string,
boolean ignoreIfInUrl,
Pattern issueKeyBoundaryRegex)
Find the JIRA issue keys within the given string.
|
Collection<String> |
findIssueKeysInText(String string)
Find the and JIRA issue keys within the given string.
|
Set<String> |
findIssueKeysInText(String string,
boolean ignoreIfInUrl)
Find the and JIRA issue keys within the given string.
|
List<String> |
findIssueKeysInTextAsList(String string,
boolean ignoreIfInUrl)
Find the JIRA issue keys within the given string.
|
List<LinkedJiraIssue> |
getFilteredFixedJiraIssues(Collection<LinkedJiraIssue> possibleIssues,
int numberNeeded) |
List<LinkedJiraIssue> |
getFilteredJiraIssues(Collection<LinkedJiraIssue> possibleIssues,
int numberNeeded)
Returns a required length list of jira issues and controls logic behind which are shown
* Fixed issues are given preference
This is needed so that only the required number of JIRA Issues will be retrieved from the jira server
|
List<LinkedJiraIssue> |
getFilteredRelatedJiraIssues(Collection<LinkedJiraIssue> possibleIssues,
int numberNeeded) |
Set<LinkedJiraIssue> |
getFixedJiraIssues(Iterable<LinkedJiraIssue> allIssues)
returns a set of all jira issues with link type 'fixed'
|
static JiraIssueUtils |
getFreemarkerInstance() |
static String |
getJiraDisplayUrl(com.atlassian.applinks.api.ApplicationLink applicationLink,
String issueKey) |
protected String |
getJiraIssueTitleText() |
static String |
getJiraIssueUrl(String host,
JiraIssueKey issueKey,
JiraIssueUtils.JiraPanel panel) |
static String |
getJiraUrl(com.atlassian.applinks.api.ApplicationLink applicationLink,
String issueKey) |
Set<LinkedJiraIssue> |
getRelatedJiraIssues(Iterable<LinkedJiraIssue> allIssues)
returns a set of all jira issues with link type 'related'
|
String |
getRenderedString(String inputString)
Renders any jira links within the input string
|
String |
getRenderedString(String inputString,
DeploymentVersion deploymentVersion)
Renders valid jira issues in the input string, valid issues are determined by what is stored in the DeploymentVersion
|
String |
getRenderedString(String inputString,
ImmutableResultsSummary resultsSummary)
Renders valid jira issues in the input string, valid issues are determined by what is stored in the BuildResultSummary
|
String |
getRenderedString(String inputString,
String buildKey,
Integer buildNumber)
Renders valid jira issues in the input string, valid issues are determined by what is stored in the BuildResultSummary
|
boolean |
isJiraServerSetup() |
boolean |
isValidIssueKey(String string)
Checks whether a given string is a valid issue key
|
void |
setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) |
static com.google.common.base.Function<InternalLinkedJiraIssue,String> |
transformJiraIssueToJiraIssueKey() |
public static final String PROJECT_ISSUE_NUMBER_SEPARATOR
public static final String RENDERED_JIRA_KEY
public static final String RENDERED_JIRA_KEY_NO_SERVER
public JiraIssueUtils(JiraApplinksService jiraApplinksService, ResultsSummaryManager resultsSummaryManager, com.atlassian.event.api.EventPublisher eventPublisher, AdministrationConfigurationAccessor administrationConfigurationAccessor)
public static JiraIssueUtils getFreemarkerInstance()
public void findAndSaveJiraIssueKeys(@NotNull String string, @NotNull ResultsSummary buildResultsSummary)
string
- buildResultsSummary
- public boolean isValidIssueKey(@NotNull String string)
string
- @NotNull public Set<LinkedJiraIssue> getFixedJiraIssues(@NotNull Iterable<LinkedJiraIssue> allIssues)
allIssues
- @NotNull public Set<LinkedJiraIssue> getRelatedJiraIssues(@NotNull Iterable<LinkedJiraIssue> allIssues)
allIssues
- @NotNull public Collection<String> findIssueKeysInText(@NotNull String string)
string
- @NotNull public Set<String> findIssueKeysInText(@NotNull String string, boolean ignoreIfInUrl)
string
- ignoreIfInUrl
- @NotNull public LinkedHashSet<String> findIssueKeys(String string, boolean ignoreIfInUrl, Pattern issueKeyBoundaryRegex)
string
- ignoreIfInUrl
- @NotNull public List<String> findIssueKeysInTextAsList(String string, boolean ignoreIfInUrl)
string
- ignoreIfInUrl
- @Nullable public String getRenderedString(@Nullable String inputString, @NotNull String buildKey, @NotNull Integer buildNumber)
inputString
- buildKey
- buildNumber
- @Nullable public String getRenderedString(@Nullable String inputString, @NotNull ImmutableResultsSummary resultsSummary)
inputString
- resultsSummary
- @Nullable public String getRenderedString(@Nullable String inputString, @NotNull DeploymentVersion deploymentVersion)
inputString
- @Nullable public String getRenderedString(@Nullable String inputString)
inputString
- @Nullable public static String getJiraUrl(@NotNull com.atlassian.applinks.api.ApplicationLink applicationLink, @NotNull String issueKey)
@Nullable public static String getJiraDisplayUrl(@NotNull com.atlassian.applinks.api.ApplicationLink applicationLink, @NotNull String issueKey)
@NotNull public static String getJiraIssueUrl(@NotNull String host, @NotNull JiraIssueKey issueKey, @Nullable JiraIssueUtils.JiraPanel panel)
protected String getJiraIssueTitleText()
@NotNull public List<LinkedJiraIssue> getFilteredJiraIssues(@Nullable Collection<LinkedJiraIssue> possibleIssues, int numberNeeded)
possibleIssues
- numberNeeded
- @NotNull public List<LinkedJiraIssue> getFilteredFixedJiraIssues(@Nullable Collection<LinkedJiraIssue> possibleIssues, int numberNeeded)
@NotNull public List<LinkedJiraIssue> getFilteredRelatedJiraIssues(@Nullable Collection<LinkedJiraIssue> possibleIssues, int numberNeeded)
public boolean isJiraServerSetup()
public static com.google.common.base.Function<JiraXmlSearchResultItemEntity,JiraIssueDetails> buildJiraIssueDetailsFromSearchResultFunction(@NotNull com.atlassian.applinks.api.ApplicationLink applicationLink, JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
JiraIssueDetails
from JIRA XML search resultFunction
public static com.google.common.base.Function<InternalLinkedJiraIssue,String> transformJiraIssueToJiraIssueKey()
public void setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.