def __resolve_templates(
            self,
            raw_values: List[str],
            finding: Finding,
            fallback: Optional[str] = None,
            prepend: Optional[str] = None,
            log_context: str = "value",
    ) -> List[str]:
        """Resolve a list of dynamic or static values, optionally handling templated strings and prepending one fixed value."""
        returned_values = [prepend] if prepend else []

        for value_str in raw_values:
            try:
                if "$" in value_str:
                    evaluated_value = ChannelTransformer.template(
                        value_str,
                        fallback,
                        self.cluster_name,
                        finding.subject.labels,
                        finding.subject.annotations,
                    )
                    if evaluated_value and evaluated_value not in returned_values:
                        returned_values.append(evaluated_value)
                else:
                    if value_str and value_str not in returned_values:
                        returned_values.append(value_str)
            except Exception as e:
                logging.warning(
                    f"Failed to process {log_context} '{value_str}' for alert subject {finding.service_key}: {e}"
                )
                continue

        return returned_values
Resolve a list of dynamic or static values, optionally handling templated strings and prepending one fixed value.
src/robusta/core/sinks/opsgenie/opsgenie_sink.py