## Issue Tracker Report Script "Issues-pointing-at-Peter"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=issue
##title=Issues pointing at Peter
##
name = 'peter'

issue_status = issue.getStatus().lower()

if issue_status in ('completed','rejected'):
    # ignore these
    return False

assignments = issue.getAssignments()
if assignments:
    last_ass = assignments[-1]
    if last_ass.getAssigneeFullname().lower().find(name) > -1:
        return True

# it could also be that the issue is taken and the last followupper is 
# you.
if issue_status=='taken':
    followups = issue.ListThreads()
    if followups and followups[-1].getFromname().lower().find(name) > -1:
        return True


# default thing to do is to NOT include the issue
return False

