Example #1
0
     'method': 'Bug.search',
     'params': json.dumps([bzSearchParams])
 }
 # fetch matching bugs
 bugs = bingle.getBugEntries(bugzillaPayload)
 bingle.info('Number of bugs: %s' % len(bugs))
 counter = 0
 cardsToUpdate = []
 for bug in bugs:
     # see if there's a mingle card matching this bug
     # TODO: refactor this; it's repeated below
     if len(bugIdFieldName) > 0:
         foundBug = mingle.findCardNumByBugId(
             bugCard, bug.get('id'), bugIdFieldName)
     else:
         foundBug = mingle.findCardNumByBugName(
             bugCard, bug.get('id'), bug.get('summary'))
     bingle.info(mingle.dumpRequest())
     if len(foundBug) < 1:
         # eh... we probably want to do something else here
         continue
     cardId = foundBug[0]['Number']
     # figure out the card's status
     # TODO: make 'status' field configurable
     status = mingle.getCardById(cardId).getStatus('Status')
     # TODO: make this list of statuses configurable
     if status not in ['In Development',
                       'Awaiting Final Code Review',
                       'Ready for Signoff',
                       'Accepted']:
         counter += 1
         cardToUpdate = (cardId, bug.get('id'))