def METHOD_NAME(project, version_data):
    """
    Get or create version using the ``commit`` as identifier, and PR id as ``verbose_name``.
    if external version does not exist create an external version
    :param project: Project instance
    :param version_data: A :py:class:`readthedocs.api.v2.views.integrations.ExternalVersionData`
     instance.
    :returns: External version.
    :rtype: Version
    """
    external_version, created = project.versions.get_or_create(
        verbose_name=version_data.id,
        type=EXTERNAL,
        defaults={
            "identifier": version_data.commit,
            "active": True,
            "state": EXTERNAL_VERSION_STATE_OPEN,
        },
    )
    if created:
        log.info(
            'External version created.',
            project_slug=project.slug,
            version_slug=external_version.slug,
        )
    else:
        # Identifier will change if there is a new commit to the Pull/Merge Request.
        external_version.identifier = version_data.commit
        # If the PR was previously closed it was marked as closed
        external_version.state = EXTERNAL_VERSION_STATE_OPEN
        external_version.save()
        log.info(
            'External version updated.',
            project_slug=project.slug,
            version_slug=external_version.slug,
        )
    return external_version