'Creates a new issue that is linked to an issue in a support auditor'

def link_to_support_item_issues(self, item, sub_item, sub_issue_message=None, issue_message=None, issue=None, score=None):

    matching_issues = []
    for sub_issue in sub_item.issues:
        if ((not sub_issue_message) or (sub_issue.issue == sub_issue_message)):
            matching_issues.append(sub_issue)
    if (len(matching_issues) > 0):
        for matching_issue in matching_issues:
            if (issue is None):
                if (issue_message is None):
                    if (sub_issue_message is not None):
                        issue_message = sub_issue_message
                    else:
                        issue_message = 'UNDEFINED'
                if (score is not None):
                    issue = self.add_issue(score, issue_message, item)
                else:
                    issue = self.add_issue(matching_issue.score, issue_message, item)
            elif (score is not None):
                issue.score = score
            else:
                issue.score = (issue.score + matching_issue.score)
        issue.sub_items.append(sub_item)
    return issue
