com.atlassian.bamboo.jira.jiraissues
Class JiraIssueUtils

java.lang.Object
  extended by com.atlassian.bamboo.jira.jiraissues.JiraIssueUtils

public class JiraIssueUtils
extends java.lang.Object


Nested Class Summary
static class JiraIssueUtils.JiraPanel
           
 
Field Summary
static java.lang.String PROJECT_ISSUE_NUMBER_SEPARATOR
           
static java.lang.String RENDERED_JIRA_KEY
           
static java.lang.String RENDERED_JIRA_KEY_NO_SERVER
           
 
Constructor Summary
JiraIssueUtils(JiraApplinksService jiraApplinksService, ResultsSummaryManager resultsSummaryManager, com.atlassian.event.EventManager eventManager, AdministrationConfigurationManager administrationConfigurationManager, JiraRemoteIssueManager jiraRemoteIssueManager)
           
 
Method Summary
static com.google.common.base.Function<JiraXmlSearchResultItemEntity,JiraIssueDetails> buildJiraIssueDetailsFromSearchResultFunction(JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
          Returns function which builds JiraIssueDetails from JIRA XML search result
 void findAndSaveJiraIssueKeys(java.lang.String string, ResultsSummary buildResultsSummary)
          Finds any jira issue keys in the given input string, and saves them against the given build result summary.
 java.util.Collection<java.lang.String> findIssueKeysInText(java.lang.String string)
          Find the and JIRA issue keys within the given string.
 java.util.Set<java.lang.String> findIssueKeysInText(java.lang.String string, boolean ignoreIfInUrl)
          Find the and JIRA issue keys within the given string.
 java.util.List<LinkedJiraIssue> getFilteredFixedJiraIssues(java.util.Collection<LinkedJiraIssue> possibleIssues, int numberNeeded)
           
 java.util.List<LinkedJiraIssue> getFilteredJiraIssues(java.util.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
 java.util.List<LinkedJiraIssue> getFilteredRelatedJiraIssues(java.util.Collection<LinkedJiraIssue> possibleIssues, int numberNeeded)
           
 java.util.Set<LinkedJiraIssue> getFixedJiraIssues(java.lang.Iterable<LinkedJiraIssue> allIssues)
          returns a set of all jira issues with link type 'fixed'
static JiraIssueUtils getFreemarkerInstance()
           
static java.lang.String getJiraIssueUrl(java.lang.String host, JiraIssueKey issueKey, JiraIssueUtils.JiraPanel panel)
           
static java.lang.String getJiraIssueUrl(java.lang.String host, java.lang.String issueKey, JiraIssueUtils.JiraPanel panel)
          Deprecated. since 3.2 use $getJiraIssueUrl(String, JiraIssueKey, com.atlassian.bamboo.jira.jiraissues.JiraIssueUtils.JiraPanel)
static java.lang.String getJiraUrl(com.atlassian.applinks.api.ApplicationLink applicationLink, java.lang.String issueKey)
           
 java.lang.String getJiraUrl(java.lang.String issueKey)
          Deprecated. since 3.2 use getJiraRedirectUrl(java.lang.String, java.lang.String)
 java.util.Set<LinkedJiraIssue> getRelatedJiraIssues(java.lang.Iterable<LinkedJiraIssue> allIssues)
          returns a set of all jira issues with link type 'related'
 java.lang.String getRenderedString(java.lang.String inputString)
          Renders any jira links within the input string
 java.lang.String getRenderedString(java.lang.String inputString, ResultsSummary resultsSummary)
          Renders valid jira issues in the input string, valid issues are determined by what is stored in the BuildResultSummary
 java.lang.String getRenderedString(java.lang.String inputString, java.lang.String buildKey, java.lang.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(java.lang.String string)
          Checks whether a given string is a valid issue key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECT_ISSUE_NUMBER_SEPARATOR

public static final java.lang.String PROJECT_ISSUE_NUMBER_SEPARATOR
See Also:
Constant Field Values

RENDERED_JIRA_KEY

public static final java.lang.String RENDERED_JIRA_KEY
See Also:
Constant Field Values

RENDERED_JIRA_KEY_NO_SERVER

public static final java.lang.String RENDERED_JIRA_KEY_NO_SERVER
See Also:
Constant Field Values
Constructor Detail

JiraIssueUtils

public JiraIssueUtils(JiraApplinksService jiraApplinksService,
                      ResultsSummaryManager resultsSummaryManager,
                      com.atlassian.event.EventManager eventManager,
                      AdministrationConfigurationManager administrationConfigurationManager,
                      JiraRemoteIssueManager jiraRemoteIssueManager)
Method Detail

getFreemarkerInstance

public static JiraIssueUtils getFreemarkerInstance()

findAndSaveJiraIssueKeys

public void findAndSaveJiraIssueKeys(@NotNull
                                     java.lang.String string,
                                     @NotNull
                                     ResultsSummary buildResultsSummary)
Finds any jira issue keys in the given input string, and saves them against the given build result summary.

Parameters:
string -
buildResultsSummary -

isValidIssueKey

public boolean isValidIssueKey(@NotNull
                               java.lang.String string)
Checks whether a given string is a valid issue key

Parameters:
string -
Returns:

getFixedJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getFixedJiraIssues(@NotNull
                                                                 java.lang.Iterable<LinkedJiraIssue> allIssues)
returns a set of all jira issues with link type 'fixed'

Parameters:
allIssues -
Returns:

getRelatedJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getRelatedJiraIssues(@NotNull
                                                                   java.lang.Iterable<LinkedJiraIssue> allIssues)
returns a set of all jira issues with link type 'related'

Parameters:
allIssues -
Returns:

findIssueKeysInText

@NotNull
public java.util.Collection<java.lang.String> findIssueKeysInText(@NotNull
                                                                          java.lang.String string)
Find the and JIRA issue keys within the given string.

Parameters:
string -
Returns:
A Collection of JIRA Issue Keys

findIssueKeysInText

@NotNull
public java.util.Set<java.lang.String> findIssueKeysInText(@NotNull
                                                                   java.lang.String string,
                                                                   boolean ignoreIfInUrl)
Find the and JIRA issue keys within the given string.

Parameters:
string -
ignoreIfInUrl -
Returns:
A Collection of JIRA Issue Keys

getRenderedString

@Nullable
public java.lang.String getRenderedString(@Nullable
                                                   java.lang.String inputString,
                                                   @NotNull
                                                   java.lang.String buildKey,
                                                   @NotNull
                                                   java.lang.Integer buildNumber)
Renders valid jira issues in the input string, valid issues are determined by what is stored in the BuildResultSummary

Parameters:
inputString -
buildKey -
buildNumber -
Returns:

getRenderedString

@Nullable
public java.lang.String getRenderedString(@Nullable
                                                   java.lang.String inputString,
                                                   @NotNull
                                                   ResultsSummary resultsSummary)
Renders valid jira issues in the input string, valid issues are determined by what is stored in the BuildResultSummary

Parameters:
inputString -
resultsSummary -
Returns:

getRenderedString

@Nullable
public java.lang.String getRenderedString(@Nullable
                                                   java.lang.String inputString)
Renders any jira links within the input string

Parameters:
inputString -
Returns:

getJiraUrl

@Nullable
public static java.lang.String getJiraUrl(@NotNull
                                                   com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                   @NotNull
                                                   java.lang.String issueKey)

getJiraUrl

@Nullable
@Deprecated
public java.lang.String getJiraUrl(@Nullable
                                                       java.lang.String issueKey)
Deprecated. since 3.2 use getJiraRedirectUrl(java.lang.String, java.lang.String)

Parameters:
issueKey -
Returns:

getJiraIssueUrl

@NotNull
@Deprecated
public static java.lang.String getJiraIssueUrl(@NotNull
                                                                  java.lang.String host,
                                                                  @NotNull
                                                                  java.lang.String issueKey,
                                                                  @Nullable
                                                                  JiraIssueUtils.JiraPanel panel)
Deprecated. since 3.2 use $getJiraIssueUrl(String, JiraIssueKey, com.atlassian.bamboo.jira.jiraissues.JiraIssueUtils.JiraPanel)


getJiraIssueUrl

@NotNull
public static java.lang.String getJiraIssueUrl(@NotNull
                                                       java.lang.String host,
                                                       @NotNull
                                                       JiraIssueKey issueKey,
                                                       @Nullable
                                                       JiraIssueUtils.JiraPanel panel)

getFilteredJiraIssues

@NotNull
public java.util.List<LinkedJiraIssue> getFilteredJiraIssues(@Nullable
                                                                     java.util.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

Parameters:
possibleIssues -
numberNeeded -
Returns:

getFilteredFixedJiraIssues

@NotNull
public java.util.List<LinkedJiraIssue> getFilteredFixedJiraIssues(@Nullable
                                                                          java.util.Collection<LinkedJiraIssue> possibleIssues,
                                                                          int numberNeeded)

getFilteredRelatedJiraIssues

@NotNull
public java.util.List<LinkedJiraIssue> getFilteredRelatedJiraIssues(@Nullable
                                                                            java.util.Collection<LinkedJiraIssue> possibleIssues,
                                                                            int numberNeeded)

isJiraServerSetup

public boolean isJiraServerSetup()

buildJiraIssueDetailsFromSearchResultFunction

public static com.google.common.base.Function<JiraXmlSearchResultItemEntity,JiraIssueDetails> buildJiraIssueDetailsFromSearchResultFunction(JiraIssueDetailsBuilderFactory jiraIssueDetailsBuilderFactory)
Returns function which builds JiraIssueDetails from JIRA XML search result

Returns:
Function


Copyright © 2011 Atlassian. All Rights Reserved.