def METHOD_NAME(identity):
    """Find and set autoenablestep"""
    event = identity.events.filter(
        autoenablestep__isnull=False, justification=identity.justification
    ).order_by('-event_time')[0]
    if event:
        return event.autoenablestep
    else:
        return 0