def fetch_all(self, type): ci_fieldname = settings.ISSUETRACKERS['default']['CI_FIELD_NAME'] analysis = settings.ISSUETRACKERS['default']['IMPACT_ANALYSIS_FIELD_NAME'] problems_field = settings.ISSUETRACKERS['default']['PROBLEMS_FIELD_NAME'] params = dict(jql='type=%s' % type, maxResults=1024) issues = Jira().find_issues(params) items_list = [] for issue in issues.get('issues'): field = issue.get('fields') assignee = field.get('assignee') problems = field.get(problems_field) or [] ret_problems = [problem.get('value') for problem in problems] selected_problems = ', '.join(ret_problems) if ret_problems else None priority = field.get('priority') issuetype = field.get('issuetype') items_list.append( dict( ci=field.get(ci_fieldname), key=issue.get('key'), description=field.get('description', ''), summary=field.get('summary'), status=field.get('status').get('name'), assignee=assignee.get('displayName') if assignee else '', analysis=field.get(analysis), problems=selected_problems, priority=priority.get('iconUrl') if priority else '', issue_type=issuetype.get('name') if issuetype else '', update_date=field.get('updated'), created_date=field.get('created'), resolvet_date=field.get('resolutiondate'), planned_start_date=field.get('customfield_11602'), planned_end_date=field.get('customfield_11601'), ) ) return items_list
def fetch_all(self, type, cutoff_date=None): ci_fieldname = settings.ISSUETRACKERS['default']['CI_FIELD_NAME'] analysis = settings.ISSUETRACKERS['default'][ 'IMPACT_ANALYSIS_FIELD_NAME'] problems_field = settings.ISSUETRACKERS['default'][ 'PROBLEMS_FIELD_NAME'] jql = ('type={}'.format(type)) if cutoff_date is not None: jql += " AND status CHANGED AFTER '{}'".format( cutoff_date.strftime('%Y/%m/%d %H:%m')) params = dict(jql=jql) offset = 0 total = None while offset != total: params['startAt'] = offset issues = Jira().find_issues(params) total = issues['total'] for issue in issues.get('issues'): field = issue.get('fields') assignee = field.get('assignee') problems = field.get(problems_field) or [] ret_problems = [problem.get('value') for problem in problems] selected_problems = (', '.join(ret_problems) if ret_problems else None) priority = field.get('priority') issuetype = field.get('issuetype') result = dict( key=issue.get('key'), description=field.get('description', ''), summary=field.get('summary'), status=field.get('status').get('name'), assignee=assignee.get('displayName') if assignee else '', analysis=field.get(analysis), problems=selected_problems, priority=priority.get('iconUrl') if priority else '', issue_type=issuetype.get('name') if issuetype else '', update_date=field.get('updated'), created_date=field.get('created'), resolvet_date=field.get('resolutiondate'), planned_start_date=field.get('customfield_11602'), planned_end_date=field.get('customfield_11601'), ) # For a legacy plugin we store the sole CI as result['ci'] # For the new plugin we store all the CIs (both main and # additional) as result['cis'] if settings.ISSUETRACKERS['default'].get( 'LEGACY_PLUGIN', True, ): result['ci'] = field.get(ci_fieldname) result['cis'] = [] else: result['ci'] = None result['cis'] = field.get(ci_fieldname) yield result offset += len(issues['issues']) print("{} of {}".format(offset, total))
def fetch_all(self, type, cutoff_date=None): ci_fieldname = settings.ISSUETRACKERS['default']['CI_FIELD_NAME'] analysis = settings.ISSUETRACKERS['default'][ 'IMPACT_ANALYSIS_FIELD_NAME' ] problems_field = settings.ISSUETRACKERS['default'][ 'PROBLEMS_FIELD_NAME' ] jql = ('type={}'.format(type)) if cutoff_date is not None: jql += " AND status CHANGED AFTER '{}'".format( cutoff_date.strftime('%Y/%m/%d %H:%m') ) params = dict(jql=jql) offset = 0 total = None while offset != total: params['startAt'] = offset issues = Jira().find_issues(params) total = issues['total'] for issue in issues.get('issues'): field = issue.get('fields') assignee = field.get('assignee') problems = field.get(problems_field) or [] ret_problems = [problem.get('value') for problem in problems] selected_problems = ( ', '.join(ret_problems) if ret_problems else None ) priority = field.get('priority') issuetype = field.get('issuetype') yield dict( ci=field.get(ci_fieldname), key=issue.get('key'), description=field.get('description', ''), summary=field.get('summary'), status=field.get('status').get('name'), assignee=assignee.get('displayName') if assignee else '', analysis=field.get(analysis), problems=selected_problems, priority=priority.get('iconUrl') if priority else '', issue_type=issuetype.get('name') if issuetype else '', update_date=field.get('updated'), created_date=field.get('created'), resolvet_date=field.get('resolutiondate'), planned_start_date=field.get('customfield_11602'), planned_end_date=field.get('customfield_11601'), ) offset += len(issues['issues']) print ("{} of {}".format(offset, total))
def __init__(self): self.engine = settings.ISSUETRACKERS['default']['ENGINE'] if self.engine == 'JIRA': self.concrete = Jira() elif self.engine == '': self.concrete = NullIssueTracker() else: raise ImproperlyConfigured("Engine %s not known" % self.engine)
def fetch_all(self, type): ci_fieldname = settings.ISSUETRACKERS['default']['CI_FIELD_NAME'] params = dict(jql='type=%s' % type, maxResults=1024) issues = Jira().find_issues(params) items_list = [] for i in issues.get('issues'): f = i.get('fields') ci_id = f.get(ci_fieldname) assignee = f.get('assignee') items_list.append( dict(ci=ci_id, key=i.get('key'), description=f.get('description', ''), summary=f.get('summary'), status=f.get('status').get('name'), time=f.get('updated') or f.get('created'), assignee=assignee.get('displayName') if assignee else '')) return items_list
def fetch_all(self, type): ci_fieldname = settings.JIRA_CI_CUSTOM_FIELD_NAME params = dict(jql='project = AGS and type=%s' % type, maxResults=1024) issues = Jira().find_issue(params) items_list = [] for i in issues.get('issues'): f = i.get('fields') ci_id = f.get(ci_fieldname) assignee = f.get('assignee') items_list.append(dict( ci=ci_id, key=i.get('key'), description=f.get('description',''), summary=f.get('summary'), status=f.get('status').get('name'), time=f.get('updated') or f.get('created'), assignee=assignee.get('displayName') if assignee else '') ) return items_list
def fetch_all(self, type): ci_fieldname = settings.ISSUETRACKERS['default']['CI_FIELD_NAME'] analysis = settings.ISSUETRACKERS['default'][ 'IMPACT_ANALYSIS_FIELD_NAME'] problems_field = settings.ISSUETRACKERS['default'][ 'PROBLEMS_FIELD_NAME'] params = dict(jql='type=%s' % type, maxResults=1024) issues = Jira().find_issues(params) items_list = [] for issue in issues.get('issues'): field = issue.get('fields') assignee = field.get('assignee') problems = field.get(problems_field) or [] ret_problems = [problem.get('value') for problem in problems] selected_problems = ', '.join( ret_problems) if ret_problems else None priority = field.get('priority') issuetype = field.get('issuetype') items_list.append( dict( ci=field.get(ci_fieldname), key=issue.get('key'), description=field.get('description', ''), summary=field.get('summary'), status=field.get('status').get('name'), assignee=assignee.get('displayName') if assignee else '', analysis=field.get(analysis), problems=selected_problems, priority=priority.get('iconUrl') if priority else '', issue_type=issuetype.get('name') if issuetype else '', update_date=field.get('updated'), created_date=field.get('created'), resolvet_date=field.get('resolutiondate'), planned_start_date=field.get('customfield_11602'), planned_end_date=field.get('customfield_11601'), )) return items_list