bugzillaPayload = { 'method': 'Bug.search', 'params': json.dumps([{ 'product': product, 'component': component, 'status': ['UNCONFIRMED', 'NEW'], 'last_change_time': fromTime, }]) } for bug in bingle.getBugEntries(bugzillaPayload): bingle.info("Bug XML: %s" % bug) bugCardName = bingle.generateBugCardName( bug.get('id', '---'), bug.get('summary').encode('ascii', 'ignore')) # see if there's a mingle card matching this bug if len(bugIdFieldName) > 0: foundBug = mingle.findCardNumByBugId(bugCard, bug.get('id'), bugIdFieldName) else: foundBug = mingle.findCardNumByName(bugCard, bugCardName) bingle.info(mingle.dumpRequest()) if len(foundBug) > 0: bingle.info('Existing card(s) %s match bug %s, so skip it.' % (','.join([str(m['Number']) for m in foundBug]), bug.get('id'))) continue else:
bingle.info("Pretend mode: %s" % options.pretend) # prepare Mingle instance mingle = Mingle(auth, apiBaseUrl) fromTime = bingle.getTimeFromPickle() bugzillaPayload = {'method': 'Bug.search', 'params': json.dumps([{ 'product': product, 'component': component, 'status': ['UNCONFIRMED', 'NEW'], 'last_change_time': fromTime, }])} for bug in bingle.getBugEntries(bugzillaPayload): bingle.info("Bug XML: %s" % bug) bugCardName = bingle.generateBugCardName( bug.get('id', '---'), bug.get('summary').encode('ascii', 'ignore')) # see if there's a mingle card matching this bug if len(bugIdFieldName) > 0: foundBug = mingle.findCardNumByBugId( bugCard, bug.get('id'), bugIdFieldName) else: foundBug = mingle.findCardNumByName( bugCard, bugCardName) bingle.info(mingle.dumpRequest()) if len(foundBug) > 0: bingle.info('Existing card(s) %s match bug %s, so skip it.' % ( ','.join([str(m['Number']) for m in foundBug]), bug.get('id'))) continue else:
'last_change_time': fromTime } if len(component[0]) > 1: params['component'] = component bugzillaPayload = { 'method': 'Bug.search', 'params': json.dumps([params]) } for entry in bingle.getBugEntries(bugzillaPayload): cardExists = False bugId = entry.get('id', '---') bugTitle = entry.get('summary').encode('UTF-8', 'ignore') if trello.prefixBugTitle: cardTitle = bingle.generateBugCardName(bugId, bugTitle) searchString = bingle.getBugCardPrefix(bugId) cards = trello.searchCardsByName(searchString) if len(cards): cardExists = True else: cardTitle = bugTitle # 1 look for existence of the card cards = trello.searchCardsByName(cardTitle) # check if we actually have a match # it looks like the API search query might do a fuzzy search, so we want to # make sure we only get a full match for card in cards: if card['name'] == cardTitle: cardExists = True if cardExists:
params = { 'product': product, 'status': ['UNCONFIRMED', 'NEW'], 'last_change_time': fromTime } if len(component[0]) > 1: params['component'] = component bugzillaPayload = {'method': 'Bug.search', 'params': json.dumps([params])} for entry in bingle.getBugEntries(bugzillaPayload): cardExists = False bugId = entry.get('id', '---') bugTitle = entry.get('summary').encode('UTF-8', 'ignore') if trello.prefixBugTitle: cardTitle = bingle.generateBugCardName(bugId, bugTitle) searchString = bingle.getBugCardPrefix(bugId) cards = trello.searchCardsByName(searchString) if len(cards): cardExists = True else: cardTitle = bugTitle # 1 look for existence of the card cards = trello.searchCardsByName(cardTitle) # check if we actually have a match # it looks like the API search query might do a fuzzy search, so we want to # make sure we only get a full match for card in cards: if card['name'] == cardTitle: cardExists = True if cardExists: