Class JiraClientUtils


  • public class JiraClientUtils
    extends Object
    Helper Class.
    Author:
    mvrueden
    • Constructor Detail

      • JiraClientUtils

        public JiraClientUtils()
    • Method Detail

      • getIssueMetaData

        public static List<com.atlassian.jira.rest.client.api.domain.CimProject> getIssueMetaData​(com.atlassian.jira.rest.client.api.JiraRestClient client,
                                                                                                  String expandos,
                                                                                                  String issueTypeName,
                                                                                                  String projectKey)
                                                                                           throws ExecutionException,
                                                                                                  InterruptedException
        Convenient method to get the meta data to create issues. It allows queriing by issueTypeName and projectKey.
        Parameters:
        client - the JiraRestClient to make the ReST call.
        expandos - The expandos, to expand the json object if required
        issueTypeName - 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:
        ExecutionException
        InterruptedException
      • getFields

        public static Collection<com.atlassian.jira.rest.client.api.domain.CimFieldInfo> getFields​(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 Iterable<? extends com.atlassian.jira.rest.client.api.domain.IssueType> getIssueTypes​(com.atlassian.jira.rest.client.api.JiraRestClient client,
                                                                                                            String projectKey)
                                                                                                     throws ExecutionException,
                                                                                                            InterruptedException
        Convenient method to get all issue types of a project.
        Parameters:
        client - The JiraRestClient
        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:
        ExecutionException
        InterruptedException