def METHOD_NAME(self, instance):
    """ Adding hierarchy data to context shared data.
    Args:
        instance (obj): publishing instance
    """
    context = instance.context
    final_context = (
        context.data["hierarchyContext"]
        if context.data.get("hierarchyContext")
        else {}
    )
    name = instance.data["asset"]
    # get handles
    handle_start = int(instance.data["handleStart"])
    handle_end = int(instance.data["handleEnd"])
    in_info = {
        "entity_type": "Shot",
        "custom_attributes": {
            "handleStart": handle_start,
            "handleEnd": handle_end,
            "frameStart": instance.data["frameStart"],
            "frameEnd": instance.data["frameEnd"],
            "clipIn": instance.data["clipIn"],
            "clipOut": instance.data["clipOut"],
            "fps": instance.data["fps"]
        },
        "tasks": instance.data["tasks"]
    }
    parents = instance.data.get('parents', [])
    actual = {name: in_info}
    for parent in reversed(parents):
        parent_name = parent["entity_name"]
        next_dict = {
            parent_name: {
                "entity_type": parent["entity_type"],
                "childs": actual
            }
        }
        actual = next_dict
    final_context = self._update_dict(final_context, actual)
    # adding hierarchy context to instance
    context.data["hierarchyContext"] = final_context