Class JiraRemoteIssueManagerImpl

    • Method Detail

      • fetchIssueDetailsFromJira

        @NotNull
        public @NotNull Result<com.atlassian.applinks.api.CredentialsRequiredException,​List<JiraIssueDetails>> fetchIssueDetailsFromJira​(@NotNull
                                                                                                                                               @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                                                                                                               @NotNull
                                                                                                                                               @NotNull String jiraProjectKey,
                                                                                                                                               @NotNull
                                                                                                                                               @NotNull Set<String> jiraIssueKeys)
        Description copied from interface: JiraRemoteIssueManager
        Fetch issue details from JIRA via XML Search. Internally issue keys are partitioned to avoid too big queries to JIRA.
        Specified by:
        fetchIssueDetailsFromJira in interface JiraRemoteIssueManager
        Parameters:
        applicationLink - identifies JIRA application to fetch issue details from
        jiraProjectKey - JIRA project key (all issue keys should be from this project)
        jiraIssueKeys - keys of issues to be searched in JIRA
        Returns:
        List of JiraIssueDetails objects representing JIRA issues or CredentialsRequiredException when authentication is required in order to establish connection with JIRA
      • fetchProjectInformationFromJira

        @NotNull
        public @NotNull Iterable<com.atlassian.applinks.host.spi.EntityReference> fetchProjectInformationFromJira​(@NotNull
                                                                                                                  @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink)
                                                                                                           throws CredentialsRequiredContextException,
                                                                                                                  com.atlassian.sal.api.net.ResponseException
        Description copied from interface: JiraRemoteIssueManager
        Fetch project list from JIRA using REST service provided by applinks.
        Specified by:
        fetchProjectInformationFromJira in interface JiraRemoteIssueManager
        Parameters:
        applicationLink - identifies JIRA application to fetch project list from
        Returns:
        Iterable of EntityReference objects representing JIRA projects
        Throws:
        CredentialsRequiredContextException
        com.atlassian.sal.api.net.ResponseException
      • getJiraApplicationLink

        public com.atlassian.applinks.api.ApplicationLink getJiraApplicationLink​(@NotNull
                                                                                 @NotNull String jiraProjectKey,
                                                                                 @Nullable
                                                                                 @Nullable Project project)
                                                                          throws CredentialsRequiredContextException,
                                                                                 com.atlassian.sal.api.net.ResponseException
        Description copied from interface: JiraRemoteIssueManager
        Retrieves the 'best' application link for a given JIRA project key. If project is supplied, It checks the primary entity link first, then proceeds with all other links. If project is not supplied, or no entity link has been found, then application links are searched: primary first, the all others.
        Specified by:
        getJiraApplicationLink in interface JiraRemoteIssueManager
        Parameters:
        jiraProjectKey - the JIRA project key that has to be available in the returned application.
        project - the project to check for entity links (optional)
        Returns:
        application link to an application with a defined jiraProjectKey
        Throws:
        CredentialsRequiredContextException
        com.atlassian.sal.api.net.ResponseException
      • fetchPartitionedIssueDetailsFromJira

        protected Result<com.atlassian.applinks.api.CredentialsRequiredException,​Iterable<JiraIssueDetails>> fetchPartitionedIssueDetailsFromJira​(@NotNull
                                                                                                                                                        @NotNull com.atlassian.applinks.api.ApplicationLink applicationLink,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull String jiraProjectKey,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull List<String> jiraIssueKeysBatch)
        Fetch details of JIRA issues using JQL and XML search
        Parameters:
        applicationLink - link to JIRA application which will handle search operation
        jiraProjectKey - JIRA project key
        jiraIssueKeysBatch - JIRA issue keys (up to XML_SEARCH_MAX_QUERY_SIZE)
        Returns:
        Iterable of JiraIssueDetails fetched from JIRA or CredentialsRequiredException when authentication is required
      • constructSearchUrl

        @NotNull
        protected @NotNull String constructSearchUrl​(@NotNull
                                                     @NotNull String projectKey,
                                                     @NotNull
                                                     @NotNull List<String> issueKeys)
        Construct JIRA search URL
        Parameters:
        projectKey - JIRA project key
        issueKeys - JIRA issue keys to be searched
        Returns:
        String to be added to JIRA RPC url to be used in http request