def get_issues()

in flink_jira_rule.py [0:0]


    def get_issues(self, jql_query, limit=10000):
        """Queries the JIRA PI for all issues that match the given JQL Query

        This method is necessary as requests tend to time out if the number of results reaches a certain number.
        So, this method requests the results in multiple queries and returns a final list of all issues.
        :param jql_query: the search query
        :param limit: the maximum number of issues that should returned
        :return: a list of issues matching the query
        """
        limit_per_api_request = min(100, limit)
        current = 0
        total = 1
        issues = []
        while current < min(total, limit):
            response = self.jira_client.jql(
                jql_query, limit=limit_per_api_request, start=current
            )
            total = response["total"]
            issues = issues + response["issues"]
            current = len(issues)
        logging.info(f'"{jql_query}" returned {len(issues)} issues')
        return issues[: min(limit, len(issues))]