Note: Use Object and Rule name in members. There is no limit in retrieving members.
What is AssignmentRule in Salesforce?
Assignment rules decide which user or queue a new Lead or Case is assigned to. Retrieving them lets you review the rule entries, compare orgs, or deploy the rules to another environment.
Steps to retrieve it in VS Code
Open your Salesforce DX project in VS Code and authorize your org with SFDX: Authorize an Org.
Open manifest/package.xml, or create the file, and paste the XML shown above.
Right-click package.xml and choose SFDX: Retrieve Source in Manifest from Org.
When the command finishes, open the folder force-app/main/default/assignmentRules to see the retrieved files.
Each member is written as ObjectName.RuleName, for example Case.Custom Rules. Use the exact name shown in Setup. Assignment rules exist only for Lead and Case.
Retrieve it with the Salesforce CLI
If you prefer the terminal, run one of these commands from your project folder:
sf project retrieve start --manifest manifest/package.xml
sf project retrieve start --manifest manifest/package.xml
Where the files are saved
After a successful retrieve, the files are placed inside your project, for example in force-app/main/default/assignmentRules/Case.assignmentRules-meta.xml.
Common problems and fixes
Entity of type AssignmentRule cannot be found: check the spelling and the API name of the member, and make sure you are authorized to the correct org.
Nothing was retrieved: run sf org list to confirm the default org, and check that the component actually exists there.
API version: the examples use version 62.0. You can use a higher version if your org supports it.
FAQ
Which objects support assignment rules? Only Lead and Case.
Can I retrieve several rules at once? Yes. Add one members line for each rule, or use the AssignmentRules type with the object name to retrieve all rules of that object.