def _format_for_common_representation(self, task):
        """
        Formats a task for common representation for action-chain.
        """
        # This really needs to be better handled on the back-end but that would be a bigger
        # change so handling in cli.
        context = getattr(task, "context", None)
        if context and "chain" in context:
            task_name_key = "context.chain.name"
        elif context and "orquesta" in context:
            task_name_key = "context.orquesta.task_name"
        # Use Execution as the object so that the formatter lookup does not change.
        # AKA HACK!
        return Execution(
            **{
                "id": task.id,
                "status": task.status,
                "task": jsutil.get_value(vars(task), task_name_key),
                "action": task.action.get("ref", None),
                "start_timestamp": task.start_timestamp,
                "end_timestamp": getattr(task, "end_timestamp", None),
            }
        )

        Formats a task for common representation for action-chain.
        
st2client/st2client/commands/action.py