Repository: rasahq/rasa
Issue: `rasa data migrate` adds `requested_slot` condition where there was none before

### Rasa Open Source version

3.0.0rc1

### Rasa SDK version

_No response_

### Rasa X version

_No response_

### Python version

3.8

### What operating system are you using?

OSX

### What happened?

Before:

```python
sales_form:
    budget:
    - entity: amount-of-money
      type: from_entity
    - entity: number
      type: from_entity
    - intent: enter_data
      type: from_text
    business_email:
    - entity: email
      type: from_entity
    - intent: enter_data
      type: from_text
```

After:

```python
slots:
  budget:
    type: any
    mappings:
    - entity: amount-of-money
      type: from_entity
      conditions:
      - active_loop: sales_form
        requested_slot: budget
    - entity: number
      type: from_entity
      conditions:
      - active_loop: sales_form
        requested_slot: budget
```

In my opinion the `requested_slot` condition for `from_entity` mappings is not necessary (we only need this for `from_text` and `from_intent` )

### Command / Request

```shell
`rasa data migrate`
```


### Relevant log output

_No response_

Changed files:
rasa/core/migrate.py, tests/core/test_migrate.py

diff --git a/rasa/core/migrate.py b/rasa/core/migrate.py
index ee0f7f73866..65a22028b43 100644
--- a/rasa/core/migrate.py
+++ b/rasa/core/migrate.py
@@ -28,14 +28,14 @@ def _create_back_up(
     return original_content
 
 
-def _update_mapping_condition(
+def _get_updated_mapping_condition(
     condition: Dict[Text, Text], mapping: Dict[Text, Any], slot_name: Text
 ) -> Dict[Text, Text]:
     if mapping.get("type") not in [
         str(SlotMapping.FROM_ENTITY),
         str(SlotMapping.FROM_TRIGGER_INTENT),
     ]:
-        condition.update({REQUESTED_SLOT: slot_name})
+        return {**condition, REQUESTED_SLOT: slot_name}
     return condition
 
 
@@ -53,20 +53,22 @@ def _get_updated_or_new_mappings(
         conditions = existing_mapping.pop("conditions", [])
         if existing_mapping in new_mappings:
             new_mappings.remove(existing_mapping)
-
-            updated_condition = _update_mapping_condition(
-                condition, existing_mapping, slot_name
+            conditions.append(
+                _get_updated_mapping_condition(condition, existing_mapping, slot_name)
             )
-
-            conditions.append(updated_condition)
             existing_mapping.update({"conditions": conditions})
             updated_mappings.append(existing_mapping)
         else:
             updated_mappings.append(mapping_copy)
 
     for mapping in new_mappings:
-        updated_condition = _update_mapping_condition(condition, mapping, slot_name)
-        mapping.update({"conditions": [updated_condition]})
+        mapping.update(
+            {
+                "conditions": [
+                    _get_updated_mapping_condition(condition, mapping, slot_name)
+                ]
+            }
+        )
         updated_mappings.append(mapping)
 
     return updated_mappings
diff --git a/tests/core/test_migrate.py b/tests/core/test_migrate.py
index 62d5e23a6c7..cf64c083311 100644
--- a/tests/core/test_migrate.py
+++ b/tests/core/test_migrate.py
@@ -441,6 +441,58 @@ def test_migrate_domain_format_with_custom_slot(tmp_path: Path, domain_out_file:
     }
 
 
+def test_migrate_domain_with_no_requested_slot_for_from_entity_mappings(
+    tmp_path: Path, domain_out_file: Path
+):
+    existing_domain_file = prepare_domain_path(
+        tmp_path,
+        """
+        version: "3.0"
+        intents:
+        - greet
+        - affirm
+        - inform
+        entities:
+        - city
+        slots:
+          location:
+            type: text
+            influence_conversation: false
+          email:
+            type: text
+            influence_conversation: false
+        forms:
+            some_form:
+                location:
+                - entity: city
+                  type: from_entity
+                - intent: something
+                  type: from_text
+        """,
+        "domain.yml",
+    )
+
+    rasa.core.migrate.migrate_domain_format(existing_domain_file, domain_out_file)
+
+    domain = Domain.from_path(domain_out_file)
+    assert domain
+
+    migrated_domain = rasa.shared.utils.io.read_yaml_file(domain_out_file)
+    migrated_slots = migrated_domain.get("slots")
+    location_slot = migrated_slots.get("location")
+    mappings = location_slot.get("mappings")
+    assert mappings[0] == {
+        "entity": "city",
+        "type": "from_entity",
+        "conditions": [{"active_loop": "some_form"}],
+    }
+    assert mappings[1] == {
+        "intent": "something",
+        "type": "from_text",
+        "conditions": [{"active_loop": "some_form", "requested_slot": "location"}],
+    }
+
+
 def test_migrate_domain_format_duplicated_slots_in_forms(
     tmp_path: Path, domain_out_file: Path
 ):