Hi,
I am trying to create a linked Jira ticket using ScriptRunner 'clone and issue, and links' post function. We want the new issue to copy all fields from parent issue but skip the attachments. I tried below code but it throws NullPointerException probably because the linked issue is not created yet.
def attachments = ComponentAccessor.attachmentManager.getAttachments(issue)
attachments.each {attachment ->
attachmentManager.deleteAttachment(attachment)
log.error("attachement removed in loop")
}
Please suggest if there is any other way to skip the attachments?