Created a Task in a different project by using "Clones an issue, and links" with the following Additional issue actions.
import com.onresolve.scriptrunner.runner.util.UserMessageUtil;
import com.atlassian.jira.component.ComponentAccessor;
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Epic Name'}
issue.setCustomFieldValue(cf, 'Cloned Issue Epic Name' + sourceIssue.key + ': ' + sourceIssue.summary)
issue.summary = 'Cloned Issue ' + sourceIssue.key + ': ' + sourceIssue.summary
The issue is created successfully and also linked with Issue link type "relates to".
Once this new issue is cloned and created, I would three subtasks to be created for the newly created issue by adding some actions to the existing script.
How can this be achieved?