Class AzureDevopsUtility


  • public class AzureDevopsUtility
    extends Object
    Utility class for the Azure DevOps Connector.

    This class provides utility methods for the Azure DevOps connector.

    Since:
    1.0.0
    Author:
    Adobe
    • Constructor Detail

      • AzureDevopsUtility

        public AzureDevopsUtility()
    • Method Detail

      • getIds

        public int[] getIds​(String query)
                     throws com.adobe.guides.konnect.definitions.core.exception.KonnectQueryException
        Returns an array integers from the comma separated query string.
        Parameters:
        query - the query string
        Returns:
        an array of work item IDs
        Throws:
        com.adobe.guides.konnect.definitions.core.exception.KonnectQueryException - if the query is in an incorrect format
      • sort

        public List<org.azd.workitemtracking.types.WorkItem> sort​(List<org.azd.workitemtracking.types.WorkItem> itemList,
                                                                  int[] ids)
        Sorts the work items based on the IDs list.
        Parameters:
        itemList - the list of work items
        ids - the work item IDs
        Returns:
        a sorted list of work items
      • getQueryDto

        public AzureDevopsQueryDto getQueryDto​(String queryJson)
                                        throws com.adobe.guides.konnect.definitions.core.exception.KonnectQueryException
        Returns the Azure DevOps query DTO from the query JSON.
        Parameters:
        queryJson - the query JSON
        Returns:
        the Azure DevOps query DTO
        Throws:
        com.adobe.guides.konnect.definitions.core.exception.KonnectQueryException - if the query is in an incorrect format
      • getConnection

        public org.azd.workitemtracking.WorkItemTrackingApi getConnection​(com.adobe.guides.konnect.definitions.core.config.Config config,
                                                                          String project)
        Creates the connector using the config object and project name.
        Parameters:
        config - the connector config
        project - the project name
        Returns:
        the WorkItemTrackingApi connection object.