I want to transfer issues between developers' projects automatically.
The workflow I have is:
When the issue in Project X transitions to state Y > Deep clones issue (with attachments) in Project Y > Clears assigned field.
How can I add this last step to this workflow?
Delete original issue to not mess up with sprint's story points.
You could also set a value in a custom field of the original issue (or just use the transition to Y) and then create an Automation for Jira rule that deletes the original issue. That could be done when the value of the custom field changes. Or it could be done when the issue in that project transitions to Y (assuming all issues that transition to Y on that project should be deleted.
Having said all of that, you might want to actually transition the original issue to another Done status category like Discarded or Aborted or some other name. Then set the Resolution on that transition to Obsolete or Won't Do or something like that. This would be preferred as Deleting issues will eventually get you into trouble.