Hi,
I want to copy all attachment from task to linked issue during transition. I am using script runner to create the linked issue and i want to add the attachments from the task.
Please provide me with a script.
Thanks,
Swarna
@Swarna Radha ,
Please refer below link, this may help
https://community.atlassian.com/t5/Jira-questions/How-to-copy-attachments-to-linked-issue-but-not-replacing/qaq-p/909627
I am getting error :
//iterate over the issues linked to the current issue through the "blocks" link type - change the link type as neededfor (Issue linkedIssue : issue.getLinkedIssues("relates to")) {//add new attachments from linked issuedef linkedAttachments = linkedIssue.get("attachment")for (Attachment linkedAttachment : linkedAttachments) {//test if this attachment from the linked issue already exists on the current issueif (!attachments.find{it.filename == linkedAttachment.filename && it.filesize == linkedAttachment.filesize && it.mimetype == linkedAttachment.mimetype})//this attachment is new, copy it to the current issueComponentAccessor.attachmentManager.copyAttachment(linkedAttachment, currentUser, issue.key)}}
Can you please let me know the error. what you are getting
Please see screenshot.
Thanks
It looks like you're new here. Sign in or register to get started.