Send attachment Jira to Jira from automation rule with REST API

An integration via REST is being carried out for the communication between Jira Software and Jira ServiceManagement and it is required to send attachments from Jira SM to Jira Software using the REST API, we are using the following endpoint: rest/api/2/issue/{issueIdOrKey}/attachments
But the physical file path is required, how can we change this path to a value that is taken from Jira SM such as {{{{attachment.content}}}}