Thanks for your posting! TestRail and JIRA are best used together and most teams use JIRA for their issue & bug tracking and user stories/requirements and TestRail for the testing part:
To export issues from JIRA and import this as cases into TestRail, you can use the CSV import feature in TestRail:
On JIRA's side, you would export your JIRA issues to Excel and then export this file in Excel to a CSV (via Save As). You can then directly import the CSV file via TestRail's CSV import. This wouldn't support the attachments but you can seamlessly view TestRail test cases & results in JIRA as well as view JIRA issues in TestRail, so you can still jump to JIRA anytime and vice versa as needed.