def to_yt_issue(target, project_id, story):
    parent = Issue()
    parent.numberInProject = str(story[u'id'])
    parent.summary = story[u'text']
    parent['Size'] = story[u'size']
    parent['Type'] = 'Feature'
    parent.created = get_created_date_for_story(story)
    color = story[u'color']
    add_value_to_custom_field(target, project_id, 'Color', color)
    parent['Color'] = color
    priority = story[u'priority']
    if len(priority):
        add_value_to_custom_field(target, project_id, 'Priority', priority)
        parent['Priority'] = priority
    if u'deadline' in story:
        parent['Deadline'] = str(to_unix_date(story[u'deadline']))
    status = story[u'status']
    add_value_to_custom_field(target, project_id, 'Status', status)
    parent['Status'] = status
    parent['State'] = story[u'phase'][u'name']
    creator = story[u'creator']
    import_user(target, creator)
    if u'owner' in story:
        owner = story[u'owner']
        import_user(target, owner)
        parent['Assignee'] = owner[u'userName']

    parent.reporterName = creator[u'userName']
    parent.comments = []
    if u'comments' in story:
        for comment in story[u'comments']:
            parent.comments.append(to_yt_comment(target, comment))
    if u'details' in story:
        parent.description = story[u'details']
    return parent
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/agilezen2youtrack.py/to_yt_issue/original