Class JiraUtils
java.lang.Object
org.jenkinsci.plugins.JiraTestResultReporter.JiraUtils
Created by tuicu.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancleanJobCacheFile(List<hudson.tasks.junit.CaseResult> testCaseResults, Job<?, ?> testJob) static StringcreateIssue(Job<?, ?> job, EnvVars envVars, hudson.tasks.junit.CaseResult test) static StringcreateIssue(Job<?, ?> job, Job<?, ?> project, EnvVars envVars, hudson.tasks.junit.CaseResult test, JiraIssueTrigger trigger, List<String> attachments) static com.atlassian.jira.rest.client.api.domain.SearchResultfindIssues(Job<?, ?> project, hudson.tasks.test.TestResult test, EnvVars envVars, com.atlassian.jira.rest.client.api.domain.input.IssueInput issueInput) To prevent the creation of duplicates lets see if we can find a pre-existing issue.static StringgetErrorMessage(com.atlassian.jira.rest.client.api.RestClientException e, String newLine) Form a single string from the messages returned in a RestClientExceptionstatic StringgetIssueURL(String serverURL, String issueKey) Constructs the URL for an issue, given the server url and the issue keyStatic getter for the JiraTestDataPublisherDescriptor singleton instancestatic voidstatic voidstatic voidstatic voidlogWarning(String message) static voidlogWarning(String message, Exception e) searchIssueKeys(Job<?, ?> job, EnvVars envVars, hudson.tasks.junit.CaseResult test) 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
-
Constructor Details
-
JiraUtils
public JiraUtils()
-
-
Method Details
-
getIssueURL
Constructs the URL for an issue, given the server url and the issue key- Parameters:
serverURL-issueKey-- Returns:
-
log
-
logError
-
logError
-
logWarning
-
logWarning
-
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 RestClientExceptionnewLine- 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
-
createIssue
public static String createIssue(Job<?, ?> job, Job<?, throws com.atlassian.jira.rest.client.api.RestClientException?> project, EnvVars envVars, hudson.tasks.junit.CaseResult test, JiraIssueTrigger trigger, List<String> attachments) - 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.RestClientExceptionGiven 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.RestClientExceptionTo 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 projecttest- the testenvVars- the environment variables- Returns:
- a SearchResult. Empty SearchResult means nothing was found.
- Throws:
com.atlassian.jira.rest.client.api.RestClientException
-