def sync_bugmail(): """ Check bugmail for updated bugs, and get their data from Bugzilla. """ bugids = get_bugmails() if bugids: numbugs = len(bugids) url = BugzillaURL(url=get_bz_url_for_bug_ids(bugids)) try: url.get_bugs(open_only=False) except BZError: # error logged in `get_bugs` log.error('Failed to update bugs from email: %s', bugids) return if NEW_RELIC: newrelic.agent.record_custom_metric('Custom/Bugmails', numbugs) log.info('Synced %d bug(s) from email', numbugs)
def sync_bugmail(): """ Check bugmail for updated bugs, and get their data from Bugzilla. """ counter = 0 bugids = get_bugmails() for slug, ids in bugids.items(): counter += len(ids) url = BugzillaURL(url=get_bz_url_for_bug_ids(ids)) proj = None if slug: try: proj = Project.objects.get(slug=slug) except Project.DoesNotExist: pass if proj: url.project = proj url.get_bugs() sys.stdout.write('.') sys.stdout.flush() if counter: print "\nSynced {0} bugs".format(counter)
def forwards(self, orm): print ' - Importing sprint data from Bugzilla.' print ' - ', for sprint in Sprint.objects.all(): if sprint.bz_url: bzurl = BugzillaURL(url=sprint.bz_url) bugs = bzurl.get_bugs(scrum_only=False, open_only=False) for bug in bugs: # at this point project and sprint ids are equal bug.project_id = bug.backlog_id = sprint.team_id bug.sprint = sprint bug.save() sys.stdout.write('.') sys.stdout.flush() print '\n - Done.'
def sync_old_sprints(): """ Get the bugs from sprints with bugzilla urls and associate them properly. """ for sprint in Sprint.objects.all(): if sprint.bz_url: bzurl = BugzillaURL(url=sprint.bz_url) bugs = bzurl.get_bugs(scrum_only=False, open_only=False) for bug in bugs: # at this point project and sprint ids are equal bug.project_id = bug.backlog_id = sprint.team_id bug.sprint = sprint bug.save() sys.stdout.write('.') sys.stdout.flush() print '\nDone.'