You may use a special template if you need close duplicate issues.
When you select a template then it starts new automation with a filled-in answer for the automation name, trigger, condition, and action that accomplishes a specific use case. You'll see "Advance compare condition" values in fields. The trigger is "Issue Linked" and the action is "Close issue".
Enter the automation name and select the project. Don't forget to enable your automation.
When trigger and condition will fire then action will happen on the board.
Try the Automation Unlimited for Jira for free on the Atlassian Marketplace.