def merge_assignment_details(self, entity_response, entity_type):
        """
        To merge assignment details.

        Args:
            entity_response (list): List of entities
            entity_type (str): Type of the entity (host/account)

        Returns:
            list: Updated List of entities
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            self.applogger.debug(
                "{}(method={}) : {} : Trying to collect information from {} endpoint.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.function_name,
                    consts.ASSIGNMENT_ENDPOINT,
                )
            )
            entity_ids_list = [str(event.get("id")) for event in entity_response]
            entity_ids = ",".join(entity_ids_list)
            entity_type_params = entity_type + "s"
            merge_json = {}
            if entity_ids:
                assignment_params = {
                    "resolved": False,
                    "page_size": consts.PAGE_SIZE,
                    entity_type_params: entity_ids,
                }
                assignment_data = self.pull_data(
                    endpoint=consts.ASSIGNMENT_ENDPOINT, params=assignment_params
                )
                self.applogger.debug(
                    "{}(method={}) : {} : Collected information from {} endpoint.".format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        self.function_name,
                        consts.ASSIGNMENT_ENDPOINT,
                    )
                )
                if assignment_data.get("results"):
                    for assignment_result in assignment_data.get("results"):
                        merge_json[assignment_result.get(entity_type + "_id")] = assignment_result

                for event in entity_response:
                    event['url'] = consts.BASE_URL + '/{}/{}?pivot={}'.format(entity_type_params, event.get("id"), consts.USER_AGENT)
                    if merge_json.get(event.get("id"), {}):
                        assignment_details = merge_json.get(event.get("id"), {})
                        entity_assignment = assignment_details.get("assigned_to", {})
                        event["assigned_to_username"] = entity_assignment.get(
                            "username", ""
                        )
            return entity_response
        except Exception as ex:
            self.applogger.error(
                '{}(method={}) : {} : Unexpected error while getting assignments data: err="{}"'.format(
                    consts.LOGS_STARTS_WITH, __method_name, self.function_name, str(ex)
                )
            )
            raise Exception(ex)

        To merge assignment details.

        Args:
            entity_response (list): List of entities
            entity_type (str): Type of the entity (host/account)

        Returns:
            list: Updated List of entities
        
Solutions/Vectra XDR/Data Connectors/VectraDataConnector/SharedCode/collector.py