def METHOD_NAME(cls, data: str) -> ActionContext:
    args = CallbackQueryFactory.decode_data(data)
    alert_group_pk = args[0]
    alert_group = AlertGroup.objects.get(pk=alert_group_pk)
    action_value = args[1]
    try:
        # if action encoded as action_code - cast it to the action_string
        action_value = int(action_value)
        action_name = CODE_TO_ACTION_MAP[action_value]
    except ValueError:
        # support legacy messages with action_name in callback data
        action_name = action_value
    action = Action(action_name)
    action_data = args[2] if len(args) >= 3 and not cls._is_oncall_identifier(args[2]) else None
    return ActionContext(alert_group=alert_group, action=action, action_data=action_data)