java.lang.Object
org.jenkinsci.plugins.JiraTestResultReporter.JiraUtils

public class JiraUtils extends Object
Created by tuicu.
  • Constructor Details

    • JiraUtils

      public JiraUtils()
  • Method Details

    • getIssueURL

      public static String getIssueURL(String serverURL, String issueKey)
      Constructs the URL for an issue, given the server url and the issue key
      Parameters:
      serverURL -
      issueKey -
      Returns:
    • log

      public static void log(String message)
    • logError

      public static void logError(String message, Exception e)
    • logError

      public static void logError(String message)
    • logWarning

      public static void logWarning(String message)
    • logWarning

      public static void logWarning(String message, Exception e)
    • getJiraDescriptor

      public static JiraTestDataPublisher.JiraTestDataPublisherDescriptor getJiraDescriptor()
      Static getter for the JiraTestDataPublisherDescriptor singleton instance
      Returns:
    • getErrorMessage

      public static String getErrorMessage(com.atlassian.jira.rest.client.api.RestClientException e, String newLine)
      Form a single string from the messages returned in a RestClientException
      Parameters:
      e - a RestClientException
      newLine - string representing the new line
      Returns:
    • createIssue

      public static String createIssue(Job<?,?> job, EnvVars envVars, hudson.tasks.junit.CaseResult test) throws com.atlassian.jira.rest.client.api.RestClientException
      Throws:
      com.atlassian.jira.rest.client.api.RestClientException
    • cleanJobCacheFile

      public static boolean cleanJobCacheFile(List<hudson.tasks.junit.CaseResult> testCaseResults, Job<?,?> testJob)
    • createIssue

      public static String createIssue(Job<?,?> job, Job<?,?> project, EnvVars envVars, hudson.tasks.junit.CaseResult test, JiraIssueTrigger trigger, List<String> attachments) throws com.atlassian.jira.rest.client.api.RestClientException
      Throws:
      com.atlassian.jira.rest.client.api.RestClientException
    • searchIssueKeys

      public static Set<String> searchIssueKeys(Job<?,?> job, EnvVars envVars, hudson.tasks.junit.CaseResult test) throws com.atlassian.jira.rest.client.api.RestClientException
      Given a test case result, it searchs for all the issue keys related with it from the local issue map or from the Jira server
      Parameters:
      job -
      envVars -
      test -
      Returns:
      related issue keys from issue map or from Jira server
      Throws:
      com.atlassian.jira.rest.client.api.RestClientException
    • findIssues

      public static com.atlassian.jira.rest.client.api.domain.SearchResult findIssues(Job<?,?> project, hudson.tasks.test.TestResult test, EnvVars envVars, com.atlassian.jira.rest.client.api.domain.input.IssueInput issueInput) throws com.atlassian.jira.rest.client.api.RestClientException
      To prevent the creation of duplicates lets see if we can find a pre-existing issue. It is a duplicate if it has the same summary and is open in the project.
      Parameters:
      project - the project
      test - the test
      envVars - the environment variables
      Returns:
      a SearchResult. Empty SearchResult means nothing was found.
      Throws:
      com.atlassian.jira.rest.client.api.RestClientException