Ejemplo n.º 1
0
    def get_issues(self, issues, limit=300):
        result = []
        keys = ','.join(issues)
        request = 'project=%s AND key in (%s)' % (self.settings.project, keys)
        LOGGER.debug(request)
        response = self.proxy.getIssuesFromJqlSearch(self.get_token(), request, Types.intType(limit))

        for item in response:
            issue = JiraIssue()
            issue.parse_raw(item)
            result.append(issue)
        return result
Ejemplo n.º 2
0
    def store_outdated_issues():
        env = jira_rpc_init(LOGGER)
        client = env['client']
        auth = env['auth']
        project_name = env['project_name']

        request = '''Sprint in openSprints() AND project = {project}
            AND type in (Story, Bug, Improvement) AND status in (Defined,Undefined,"In Progress")
            AND "Estimation Date" <= endOfDay()'''.format(project=project_name)

        LOGGER.info('Queuing JIRA for outdated issues...')
        response = client.getIssuesFromJqlSearch(auth, request, Types.intType(20))
        LOGGER.info('Response contains {count} issues'.format(count=len(response)))

        LOGGER.info('Removing all outdated issues from database...')
        OutdatedJiraIssue.objects.all().delete()

        LOGGER.info('Starting to import issues to database...')
        for issue in JiraUtil.__raw_data_to_issues_list__(response):
            message = '\tIssue {key} is being saved in database'.format(key=issue.key)
            LOGGER.info(message)

            outdated_jira_issue = JiraUtil.get_filled_in_outdated_jira_issue_obj(issue)
            outdated_jira_issue.save()
Ejemplo n.º 3
0
    def request(self):
        client = self.__env['client']
        auth = self.__env['auth']

        LOGGER.info('JIRA Advanced Search request: {request}'.format(request=self.__request))
        self.__response = client.getIssuesFromJqlSearch(auth, self.__request, Types.intType(self.__limit))
Ejemplo n.º 4
0
 def get_backlog_defects_count(self):
     request = BACKLOG_DEFECTS_QUERY
     response = self.proxy.getIssuesFromJqlSearch(self.get_token(), request, Types.intType(1000))
     return len(response)