The official Pokémon Brilliant Diamond and Pokémon Shining Pearl website has announced that players of Pokémon Sword game or the Pokémon Shield game can get the Mythical Pokémon Jirachi in Pokémon Brilliant Diamond and Pokémon Shining Pearl if they have a save record. Players of Pokémon: Let’s Go, Pikachu! game or the Pokémon: Let’s Go, Eevee! game can also get Mew if they have a save game.
Befriend a Mythical Pokémon
If you have game save records on your Nintendo Switch system from the Pokémon Sword game or the Pokémon Shield game, you can get the Mythical Pokémon Jirachi as a companion.
Speak to a gentleman in the flower field located on the southwest end of Floaroma Town to add Jirachi to your team.
If you have game save records on your Nintendo Switch system from the Pokémon: Let’s Go, Pikachu! game or the Pokémon: Let’s Go, Eevee! game, you can get the Mythical Pokémon Mew as a companion.
Speak to a madame in the flower field located on the southwest end of Floaroma Town to add Mew to your team.
Note: Even if you have multiple game save records from the qualifying games, you can only receive one Jirachi and one Mew in your Pokémon Brilliant Diamond or the Pokémon Shining Pearl game.
Source:
https://diamondpearl.pokemon.com/en-us/shop/other-games-bonus/