def __call__(self): print 'Getting issues, be patient...' issues = issue_tracker_tool.get_blocker_bugs_todo() for issue in issues: assignee = issue_tracker_tool.get_assignee(issue) hipchat_assignee = user_db.get_user_for_service(assignee, 'hipchat') link = issue_tracker_tool.get_link(issue) summary = issue_tracker_tool.get_summary(issue) print 'Notifying {assignee}: {summary} ({link})'.format(assignee=assignee, summary=summary, link=link) msg = 'A critical bug is assigned to you:\n{summary} ({link}) \nJust do it :)'.format( summary=summary, link=link) im_tool.send_message(hipchat_assignee, msg)
def notify_hipchat_cr(msg, issue): assigner = issue_tracker_tool.get_reviewer(issue) assignee = issue_tracker_tool.get_assignee(issue) hipchat_assignee = user_db.get_user_for_service(assignee, 'hipchat') hipchat_assigner = user_db.get_user_for_service(assigner, 'hipchat') im_tool.send_message(hipchat_assignee, msg.format(assigner=hipchat_assigner, issue=issue))