Package org.opennms.netmgt.ticketer.jira
Class JiraClientUtils
- java.lang.Object
-
- org.opennms.netmgt.ticketer.jira.JiraClientUtils
-
public class JiraClientUtils extends java.lang.Object
Helper Class.- Author:
- mvrueden
-
-
Constructor Summary
Constructors Constructor Description JiraClientUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Collection<com.atlassian.jira.rest.client.api.domain.CimFieldInfo>
getFields(java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject> cimProjects)
Convenient method to extract all fields from the projects list.static java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject>
getIssueMetaData(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String expandos, java.lang.Long issueTypeId, java.lang.String projectKey)
Does the same asgetIssueMetaData(JiraRestClient, String, String, String)
but filters by issueTypeId instead of issueTypeName.static java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject>
getIssueMetaData(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String expandos, java.lang.String issueTypeName, java.lang.String projectKey)
Convenient method to get the meta data to create issues.static java.lang.Iterable<? extends com.atlassian.jira.rest.client.api.domain.IssueType>
getIssueTypes(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String projectKey)
Convenient method to get all issue types of a project.
-
-
-
Method Detail
-
getIssueMetaData
public static java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject> getIssueMetaData(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String expandos, java.lang.String issueTypeName, java.lang.String projectKey) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenient method to get the meta data to create issues. It allows queriing by issueTypeName and projectKey.- Parameters:
client
- theJiraRestClient
to make the ReST call.expandos
- The expandos, to expand the json object if requiredissueTypeName
- Filter by issue type name (e.g. Bug). May be null.projectKey
- Filter by project key (e.g. DUM). May be null.- Returns:
- The issue meta data for the queried projects.
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getIssueMetaData
public static java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject> getIssueMetaData(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String expandos, java.lang.Long issueTypeId, java.lang.String projectKey) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Does the same asgetIssueMetaData(JiraRestClient, String, String, String)
but filters by issueTypeId instead of issueTypeName.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
- See Also:
getIssueMetaData(JiraRestClient, String, String, String)
-
getFields
public static java.util.Collection<com.atlassian.jira.rest.client.api.domain.CimFieldInfo> getFields(java.util.List<com.atlassian.jira.rest.client.api.domain.CimProject> cimProjects)
Convenient method to extract all fields from the projects list. This method expects that there is only one project in the projects list.- Parameters:
cimProjects
- The projects list. May be null or empty. May not contain more than 1 element.- Returns:
- The fields if there are any, otherwise an empty list.
-
getIssueTypes
public static java.lang.Iterable<? extends com.atlassian.jira.rest.client.api.domain.IssueType> getIssueTypes(com.atlassian.jira.rest.client.api.JiraRestClient client, java.lang.String projectKey) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Convenient method to get all issue types of a project.- Parameters:
client
- TheJiraRestClient
projectKey
- The project key. Is null or empty, all issue types are returned, otherwise issue types for the given projectKey are returned.- Returns:
- All issue types or issue types for the given projectKey.
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
-