Example #1
0
 # 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'))
     cardsToUpdate.append(cardToUpdate)
     if not options.pretend:
         # update the card to 'ready for signoff'
         # and make sure it's in this iteration
         cardParams = {
             'card[properties][][name]': 'Status',
             'card[properties][][value]': 'Ready for Signoff'
         }