Is it possible to copy attachments that are posted to the subtask ticket up to the parent ticket without erasing any of the attachments on the parent ticket?
Hi Lauren,
I'm afraid you can't do this with basic jira functionality which is available out of the box. You'll need 3rd party addons like Scriptrunner, Power Scripts or Automation for Jira to achieve this.
hi @Ivan Tovbin! I have both Scriptrunner and Automation for Jira. Could you walk me through how to use either one of them to build a subtask off of a subtask if one field on the first subtask has a certain selection? I'm using Jira Server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure thing. When exactly do you want this to trigger?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. It seems a scripted post function is the solution here. Here's the code. Use it for a scripted post function on a transition which is used to move a ticket to 'Done' status:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.AttachmentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.attachment.Attachment
import com.atlassian.jira.user.ApplicationUser
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Issue parentIssue = issue.getParentObject()
AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager()
Collection<Attachment> attachments = issue.getAttachments()
attachments.each{
attachmentManager.copyAttachment(it, currentUser, parentIssue.getKey())
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.