public class JiraClient extends Object
| Constructor and Description |
|---|
JiraClient(org.apache.http.client.HttpClient httpClient,
String uri,
ICredentials creds)
Creates an authenticated JIRA client with custom HttpClient.
|
JiraClient(String uri)
Creates a JIRA client.
|
JiraClient(String uri,
ICredentials creds)
Creates an authenticated JIRA client.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countIssues(String jql)
count issues with the given query.
|
Component.FluentCreate |
createComponent(String project)
Creates a new component in the given project.
|
Issue.FluentCreate |
createIssue(String project,
String issueType)
Creates a new issue in the given project.
|
ArrayList<IssueHistory> |
filterChangeLog(List<IssueHistory> histoy,
String fields) |
Component |
getComponent(String id)
Obtains a component given its ID.
|
List<Component> |
getComponentsAllowedValues(String project,
String issueType)
Get a list of options for a components
|
List<CustomFieldOption> |
getCustomFieldAllowedValues(String field,
String project,
String issueType)
Get a list of options for a custom field
|
Filter |
getFilter(String id)
Retrieve the jira filter with the supplied id.
|
Issue |
getIssue(String key)
Retreives the issue with the given key.
|
Issue |
getIssue(String key,
String includedFields)
Retreives the issue with the given key.
|
Issue |
getIssue(String key,
String includedFields,
String expand)
Retreives the issue with the given key.
|
ArrayList<IssueHistory> |
getIssueChangeLog(Issue issue) |
List<IssueType> |
getIssueTypes()
Obtains the list of all issue types in Jira.
|
List<Priority> |
getPriorities() |
Project |
getProject(String key)
Obtains information about a project, given its project key.
|
List<Project> |
getProjects()
Obtains the list of all projects in Jira.
|
RestClient |
getRestClient() |
String |
getSelf() |
Issue.SearchResult |
searchIssues(String jql)
Search for issues with the given query.
|
Issue.SearchResult |
searchIssues(String jql,
Integer maxResults)
Search for issues with the given query and max results.
|
Issue.SearchResult |
searchIssues(String jql,
String includedFields)
Search for issues with the given query and specify which fields to
retrieve.
|
Issue.SearchResult |
searchIssues(String jql,
String includedFields,
Integer maxResults)
Search for issues with the given query and specify which fields to
retrieve.
|
Issue.SearchResult |
searchIssues(String jql,
String includedFields,
Integer maxResults,
Integer startAt)
Search for issues with the given query and specify which fields to
retrieve.
|
Issue.SearchResult |
searchIssues(String jql,
String includedFields,
String expandFields)
Search for issues with the given query and specify which fields to
retrieve and expand.
|
Issue.SearchResult |
searchIssues(String jql,
String includedFields,
String expandFields,
Integer maxResults,
Integer startAt)
Search for issues with the given query and specify which fields to
retrieve.
|
public JiraClient(String uri) throws JiraException
uri - Base URI of the JIRA serverJiraExceptionpublic JiraClient(String uri, ICredentials creds) throws JiraException
uri - Base URI of the JIRA servercreds - Credentials to authenticate withJiraExceptionpublic JiraClient(org.apache.http.client.HttpClient httpClient,
String uri,
ICredentials creds)
throws JiraException
httpClient - Custom HttpClient to be useduri - Base URI of the JIRA servercreds - Credentials to authenticate withJiraExceptionpublic Issue.FluentCreate createIssue(String project, String issueType) throws JiraException
project - Key of the project to create inissueType - Name of the issue type to createJiraException - when something goes wrongpublic Issue getIssue(String key) throws JiraException
key - Issue key (PROJECT-123)JiraException - when something goes wrongpublic Issue getIssue(String key, String includedFields) throws JiraException
key - Issue key (PROJECT-123)includedFields - Specifies which issue fields will be included in
the result.
JiraException - when something goes wrongpublic Issue getIssue(String key, String includedFields, String expand) throws JiraException
key - Issue key (PROJECT-123)includedFields - Specifies which issue fields will be included in
the result.
expand - issue fields to expand when getting issue dataJiraException - when something goes wrongpublic int countIssues(String jql) throws JiraException
jql - JQL statementJiraException - when the search failspublic Issue.SearchResult searchIssues(String jql) throws JiraException
jql - JQL statementJiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, Integer maxResults) throws JiraException
jql - JQL statementmaxResults - limit the number of resultsJiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, String includedFields) throws JiraException
jql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
JiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, String includedFields, String expandFields) throws JiraException
jql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
expandFields - Specifies with issue fields should be expandedJiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, String includedFields, Integer maxResults) throws JiraException
jql - JQL statementmaxResults - limit the number of resultsincludedFields - Specifies which issue fields will be included in
the result.
JiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, String includedFields, Integer maxResults, Integer startAt) throws JiraException
startAt field to obtain all the results.jql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
maxResults - if non-null, defines the maximum number of
results that can be returnedstartAt - if non-null, defines the first issue to
returnJiraException - when the search failspublic Issue.SearchResult searchIssues(String jql, String includedFields, String expandFields, Integer maxResults, Integer startAt) throws JiraException
startAt field to obtain all the results.jql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
expandFields - Specifies with issue fields should be expandedmaxResults - if non-null, defines the maximum number of
results that can be returnedstartAt - if non-null, defines the first issue to
returnJiraException - when the search failspublic Filter getFilter(String id) throws JiraException
id - id of the filter to retreive.JiraExceptionpublic List<Priority> getPriorities() throws JiraException
JiraExceptionpublic List<CustomFieldOption> getCustomFieldAllowedValues(String field, String project, String issueType) throws JiraException
field - field idproject - Key of the project contextissueType - Name of the issue typeJiraException - when the search failspublic List<Component> getComponentsAllowedValues(String project, String issueType) throws JiraException
project - Key of the project contextissueType - Name of the issue typeJiraException - when the search failspublic RestClient getRestClient()
public String getSelf()
public List<Project> getProjects() throws JiraException
getProject(String)JiraException - failed to obtain the project list.public Project getProject(String key) throws JiraException
key - the project keyJiraException - failed to obtain the projectpublic List<IssueType> getIssueTypes() throws JiraException
JiraException - failed to obtain the issue type list.public Component.FluentCreate createComponent(String project)
project - Key of the project to create inpublic Component getComponent(String id) throws JiraException
id - the component IDJiraException - failed to obtain the componentpublic ArrayList<IssueHistory> filterChangeLog(List<IssueHistory> histoy, String fields)
public ArrayList<IssueHistory> getIssueChangeLog(Issue issue) throws JiraException
JiraExceptionCopyright © 2022. All rights reserved.